Skip to content

fix(fabric, textinput): implement selection properly - #2689

Merged
Saad Najmi (Saadnajmi) merged 3 commits into
microsoft:mainfrom
Saadnajmi:picks
Sep 11, 2025
Merged

fix(fabric, textinput): implement selection properly#2689
Saad Najmi (Saadnajmi) merged 3 commits into
microsoft:mainfrom
Saadnajmi:picks

Conversation

@Saadnajmi

Copy link
Copy Markdown
Collaborator

Summary:

This is part of a series of PRs where we are cherry-picking fixes from #2117 to update our Fabric implementation on macOS.

This is furthermore, a subset of commits from #2675 . This set specifically implements the text selection APIs on TextInput for macOS, along with another set of commits to reduce our diffs in RCTCopyBackedTextInput

Test Plan:

Tested the TextInput selection examples in RNTester. All seem to work well.

Summary:
**Context**
- Text selection for Fabric should match Paper
**Change**
- Use correct position for selection range
- Maintain cursor position with selection
Test Plan: https://pxl.cl/3NW99
Reviewers: lefever, #rn-desktop
Reviewed By: lefever
Differential Revision: https://phabricator.intern.facebook.com/D51282825
Summary:
We're using wrapped text views with method forwarding, which enables a view to have fully supported text input interfaces.
The text input copy helper method signature was limiting its use to RCTUITextView. To support wrapped text views the typing was changed to RCTPlatformView.
All properties used in the implementation of the copy method are declared on RCTBackedTextInputViewProtocol.
Test Plan: Tested later in this stack.
Reviewers: shawndempsey, chpurrer, #rn-desktop
Reviewed By: shawndempsey, chpurrer
Differential Revision: https://phabricator.intern.facebook.com/D51962397
Tasks: T167538822, T157889591
@Saadnajmi
Saad Najmi (Saadnajmi) merged commit 18a6c74 into microsoft:mainSep 11, 2025
86 of 93 checks passed
Sign up for freeto 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.

3 participants

@Saadnajmi@JunielKatarn@shwanton