Repository navigation
Fix first touch after a TextInput selection change being swallowed on iOS - #60580
Open
govindsmenokee wants to merge 1 commit into
Open
govindsmenokee wants to merge 1 commit into
govindsmenokee wants to merge 1 commit into
Conversation
… 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
force-pushed
the
fix-textinput-selection-responder
branch
from
December 4, 2026 22:21
a74db75 to
bdd3e0b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
On iOS, after typing into a
TextInput, the first tap on a button next to it does nothing. Only the second tap fires.TextInputpassesonSelectionChangeShouldSetResponder={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.
onSelectionChangeis 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:
TextInputwith aPressablebeside it (a message box and its Send button).Pressableonce.onPressis not called; a second tap calls it.onPress, including right after a previous press.Typing, caret moves and
onSelectionChangewere checked with the change in place.Not run: RNTester. Text selection by long-press and drag inside a
ScrollViewwas not checked separately. If this prop guards a case there, I'd be glad to narrow the fix to it.