Skip to content

Only claim the TextInput responder while a touch is active - #58477

Open
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-58445-selection-responder-active-touch
Open

Only claim the TextInput responder while a touch is active#58477
lazerg wants to merge 1 commit into
react:mainfrom
lazerg:fix/issue-58445-selection-responder-active-touch

Conversation

@lazerg

@lazerg lazerg commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary:

TextInput passes onSelectionChangeShouldSetResponder={emptyFunctionThatReturnsTrue}, so it takes the JS responder on any selection change the responder system walks. That walk is gated on trackedTouchCount > 0, and the counter counts events rather than touches: press two fingers down separately, lift them together, and it never comes back down, since two starts arrive as two events and the lift arrives as one. From then on every keystroke-driven selection change hands the responder to the focused input with no touch behind it, and the next tap elsewhere is dropped, because negotiation dispatches from the lowest common ancestor of the responder and the new target and so never reaches the new target's own onStartShouldSetResponder.

Claim it only while touchHistory.numberActiveTouches > 0, which is read from touches.length on every start and end and does track the real state. Drag selection keeps working, since a finger is down for the whole gesture.

Fixes #58445. RNTester reproducer in #58449.

Changelog:

[IOS] [FIXED] - TextInput no longer takes the touch responder on a selection change with no active touch

Test Plan:

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 10, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextInput claims the responder on every selection change, even with no active touch

1 participant