Skip to content

Conversation

Saadnajmi
Copy link
Collaborator

Summary:

Cherry pick a commit from #2117 to support Text selection, along with some changes to RCTSurfaceTouchHandler from #2394

Test Plan:

Todo

#if !TARGET_OS_OSX // [macOS]
#import <MobileCoreServices/UTCoreTypes.h>
#endif // [macOS]
#else // [macOS
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want else here

Saadnajmi added a commit that referenced this pull request Sep 10, 2025
## Summary:


Revert #2286 

There are 3 commits that make Text Selection work via NSTextView on
Fabric, but we only ever merged two of them in. The 3rd (currently in
#2673 ) is a work-in-progress, as it currently doesn't work.

I need to debug why text selection doesn't work, but as it stands, the
diffs to render with an NSTextView add more complexity for not much gain
without it. I'd rather reland all the commits together and test with an
implementation of Text closer to iOS in the meanwhile.

## Test Plan:

CI should pass
Saadnajmi and others added 2 commits September 10, 2025 15:13
Summary: Override the hitTest and mouseDown handler in `RCTParagraphComponentView` to forward mouse drag events to the underlying NSTextView to get text selection support in Fabric with correct rendering.

Test Plan:
- Run Zeratul with Fabric enabled.
- Select text
 https://pxl.cl/3q3b3

Reviewers: shawndempsey, chpurrer, #rn-desktop

Reviewed By: shawndempsey

Differential Revision: https://phabricator.intern.facebook.com/D49465174

Tasks: T163838519
@Saadnajmi Saadnajmi changed the title fix(fabric, Text): support text selection fix(fabric, Text): render with NSTextView + support text selection Sep 10, 2025
@Saadnajmi Saadnajmi changed the title fix(fabric, Text): render with NSTextView + support text selection [DRAFT] fix(fabric, Text): render with NSTextView + support text selection Sep 11, 2025
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