Repository navigation
Conversation
hsource
force-pushed
the
fix/input-use-pressability
branch
from
September 23, 2026 18:38
35f3981 to
358de94
Compare
Attach usePressability to the native input like React Native TextInput, so a tap that focuses the input claims the JS responder and no longer fires an ancestor Pressable's onPress. Adds onPress, onPressIn, onPressOut, hitSlop and rejectResponderTermination. On Android, programmatic focus no longer calls setSelection, matching ReactEditText.requestFocusProgrammatically. Pressability focuses the input on finger-up, which previously collapsed a long-press word selection. That setSelection call was also the only thing reporting some caret moves to JS: onSelectionChanged ignores changes made during an edit phase, so setValue and programmatic inserts (images, links, mentions) never emitted onChangeSelection. Emit the current selection after those phases end, as iOS already does.
Playground wraps the editor in a Pressable with a visible counter so testers can confirm taps on the input do not bubble to the parent handler, and shows the current selection range reported by onChangeSelection. Co-authored-by: Cursor <cursoragent@cursor.com>
hsource
force-pushed
the
fix/input-use-pressability
branch
from
September 23, 2026 21:23
358de94 to
3992094
Compare
Author
|
Moved upstream: software-mansion#884 |
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.
Note: this PR has been manually reviewed and is a version of code that's been part of the Wanderlog (wanderlog.com) mobile apps for the past 3 weeks
What/Why?
EnrichedMarkdownTextInputdoesn't take part in the JS touch responder system the way React NativeTextInputdoes. Wrap it in aPressable(for example a card that collapses on press), and tapping the input to focus it also fires the parent'sonPress.JS side (both Android and iOS): Fix to make taps not trigger press handlers in parents
usePressabilityto the native input, the same wayTextInputdoes. The input now claims the responder, so ancestor pressables don't fire.TextInputpropsonPress,onPressIn,onPressOutandrejectResponderTermination(defaulttrue, iOS only), typed withPick<TextInputProps, ...>so they stay in sync with React Native.hitSlopalready comes fromViewProps. All are documented inAPI_REFERENCE.md.onPressfocuses the input unlesseditable={false}, throughTextInputState.focusTextInput, the same callTextInput's hostfocus()makes. It is a no-op when the tap already focused the native view, and only matters when the press lands outside it (for example in thehitSloparea).onFocusandonBlurstill come from the native events, not from pressability.Android side: Fix to not make programmatic focus override selection
requestFocusProgrammaticallyno longer callssetSelection, matchingReactEditText.requestFocusProgrammatically.setSelectioncall was also the only thing reporting some caret moves to JS.onSelectionChangedignores changes made during an edit phase, sosetValueand programmatic inserts (images, links, mentions) never emittedonChangeSelection. The input now emits the current selection once those phases end, as iOS already does.The playground wraps the editor in a
Pressablewith a "Parent presses" counter, and shows theSelection: start-endrange reported byonChangeSelection, so both can be checked by hand and in Maestro.Testing
Checks run:
yarn typecheck, eslint, prettier, Jest, ktlint, AndroidcompileDebugKotlin, and example app builds for the iOS simulator (iPhone 17, iOS 26.4) and a Pixel 6a.Automated testing for JS Pressability fix
input_pressability_test.yamlpasses on both platforms. Tapping the editor leaves Parent presses at0; tapping the label outside it increments it to1.Automated flows:
Manual testing for Android focus setting selection fix
Setup:
screen-20260923-115440-1790189674348.mp4
screen-20260923-115833-1790189906493.mp4
PR Checklist