Skip to content

fix(textinput): show touch keyboard on focus and on tap (windowless island; re-tap reopens)#16330

Open
FaithfulAudio wants to merge 1 commit into
microsoft:0.83-stablefrom
FacilitronWorks:fix/textinput-touch-keyboard
Open

fix(textinput): show touch keyboard on focus and on tap (windowless island; re-tap reopens)#16330
FaithfulAudio wants to merge 1 commit into
microsoft:0.83-stablefrom
FacilitronWorks:fix/textinput-touch-keyboard

Conversation

@FaithfulAudio

@FaithfulAudio FaithfulAudio commented Jul 24, 2026

Copy link
Copy Markdown

Fixes #16331.

Problem

On a Windows tablet with no physical keyboard, tapping a single-line <TextInput> (e.g. a login field) never raises the touch keyboard. Additionally, after the keyboard is dismissed, re-tapping the (still-focused) field does not bring it back.

Root cause

Fabric/Composition TextInput (WindowsTextInputComponentView) has no code that requests the touch keyboard on focus — onGotFocus never touches InputPane/CoreInputView. In a WinAppSDK Win32 island app there is no CoreWindow, and the RichEdit is hosted windowless via ITextServices (no child edit HWND), so the OS's own touch-keyboard auto-invoke heuristic never fires either. Net: the keyboard never appears. (The UWP-era PR #2029 for this was closed and relied on GetForCurrentView() APIs that don't apply to the island model.)

A tap on an already-focused field does not fire onGotFocus, so a focus-only trigger can't re-raise a keyboard the user has dismissed.

Fix

New helper ShowSoftKeyboard() requests the touch keyboard via InputPane, obtained through the Win32 interop IInputPaneInterop::GetForWindow() keyed off the island's top-level AppWindow HWND (rootComponentView()->GetHwndForParenting()). Gated on slate/tablet posture (SM_CONVERTIBLESLATEMODE == 0) so it does not pop on a laptop/convertible with a keyboard attached; wrapped in try/catch so it can never break input handling.

It is called from both:

  • onGotFocus — raise the keyboard when the field gains focus, and
  • OnPointerPressed — raise it on tap, so re-tapping an already-focused field reopens a dismissed keyboard.

Focus is intentionally left untouched on keyboard dismissal (the field stays focused; the user reopens the keyboard by tapping it again — the platform-appropriate behavior here).

Uses IInputPaneInterop from <inputpaneinterop.h> and winrt::Windows::UI::ViewManagement::InputPane — both ship in the Windows SDK already referenced by Microsoft.ReactNative, so there are no .vcxproj/reference changes.

Validation

Compiled into Microsoft.ReactNative from source (yarn-patch framework build, UseExperimentalNuget=false) in a production RNW 0.83.2 new-arch app (Facilitron FIT), x64 Release, deployed to a physical x64 tablet. With the keyboard detached (Windows suppresses the touch keyboard while a hardware keyboard is attached):

  • tapping the login field raises the touch keyboard
  • dismissing the keyboard keeps the field focused
  • re-tapping the field reopens the keyboard

All three confirmed on-device. Remaining for upstream: CI build across archs.

Caveats for reviewers

@FaithfulAudio
FaithfulAudio requested a review from a team as a code owner July 24, 2026 04:00
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

…terop for windowless island; re-tap reopens a dismissed keyboard)
@FaithfulAudio
FaithfulAudio force-pushed the fix/textinput-touch-keyboard branch from 9d61725 to 6d5d4a0 Compare July 24, 2026 04:36
@FaithfulAudio FaithfulAudio changed the title fix(textinput): show touch keyboard on focus and blur on dismiss (windowless island) fix(textinput): show touch keyboard on focus and on tap (windowless island; re-tap reopens) Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant