Skip to content

Fix first touch after a TextInput selection change being swallowed on iOS - #60580

Open
govindsmenokee wants to merge 1 commit into
react:mainfrom
govindsmenokee:fix-textinput-selection-responder
Open

govindsmenokee wants to merge 1 commit into
react:mainfrom
govindsmenokee:fix-textinput-selection-responder

Conversation

@govindsmenokee

@govindsmenokee govindsmenokee commented Dec 4, 2026 •

Copy link
Copy Markdown

Summary:

On iOS, after typing into a TextInput, the first tap on a button next to it does nothing. Only the second tap fires.

TextInput passes onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue} to the native view. Every selection change (each keystroke or caret move) makes the input the JS touch responder. A selection change is not a touch, so no release ends that responder, and the input refuses termination. The next touch anywhere on screen goes to releasing the responder instead of reaching its target.

A common case is a chat composer: type a message, press Send, nothing happens; press again and it sends.

This PR removes the prop, so a selection change no longer claims the responder. onSelectionChange is still delivered as before.

Changelog:

[IOS] [FIXED] - Fix the first touch after typing in a TextInput being swallowed

Test Plan:

Reproduced in an Expo SDK 58 app on React Native 0.88.1, iOS 26 Simulator, using the software keyboard:

  1. A TextInput with a Pressable beside it (a message box and its Send button).
  2. Type a few characters, then tap the Pressable once.
    • Before: onPress is not called; a second tap calls it.
    • After: the first tap calls onPress, including right after a previous press.

Typing, caret moves and onSelectionChange were checked with the change in place.

Not run: RNTester. Text selection by long-press and drag inside a ScrollView was not checked separately. If this prop guards a case there, I'd be glad to narrow the fix to it.

… iOS

TextInput set onSelectionChangeShouldSetResponder to always return true, so
every selection change (each keystroke or caret move) made the text input the
JS touch responder. A selection change is not a touch, so no release ever
ends that responder, and the input refuses termination. The next touch
anywhere on screen is spent releasing it, so after typing, the first press of
a button next to the input does nothing and only the second one works.

Remove the prop so a selection change no longer claims the responder.
@govindsmenokee
govindsmenokee force-pushed the fix-textinput-selection-responder branch from a74db75 to bdd3e0b Compare December 4, 2026 22:21

This branch has not been deployed

No deployments
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