-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support arbitrary selectable text in Text component #1346
Commits on Aug 9, 2022
-
Support arbitrary selectable text in Text component
Summary: RN Mac's implementation of the `selectable` prop on `Text` only allows selecting the entire Text component and right click to copy. This diff makes the `Text.selectable` prop on Mac allow arbitrary selection. To do this we used `NSTextView` to render the `Text` component instead of RN Mac's custom text rendering, because it has a `selectable` property which gives us the behavior we want. We also allow adding custom menu items in the context menu. Note the change to RNTesterPage.js was required to fix microsoft#754. Test Plan: See test plan of D27250072 for integration to Zeratul. Confirmed text selection works in RNTester Text example: {F588619781} --- Also I went to RNTester Text examples and did an image diff comparison before and after these changes (differences are in pink): {F588602710} - The font smoothing isn't something we need --- {F588602715} - The examples with images are different because they load random images - The pink background on "With size and background color" isn't a difference, the background color is pink in code --- {F588602706} - The <TextInput multiline/> example has an off by 1 pixel difference that wasn't trivial to fix and doesn't seem significant enough to investigate Reviewers: skyle, ericroz Reviewed By: skyle Subscribers: eliwhite Differential Revision: https://phabricator.intern.facebook.com/D27484533 Tasks: T83817888 Signature: 27484533:1617928003:6c1c60a15db8ef3551aafe22229fafc9fea0053e # Conflicts: # Libraries/Text/Text/RCTTextView.m # React/Base/RCTTouchHandler.h # React/Base/RCTTouchHandler.m
Configuration menu - View commit details
-
Copy full SHA for e23bf89 - Browse repository at this point
Copy the full SHA e23bf89View commit details
Commits on Aug 10, 2022
-
Shawn Dempsey committed
Aug 10, 2022 Configuration menu - View commit details
-
Copy full SHA for c8917ad - Browse repository at this point
Copy the full SHA c8917adView commit details -
Revert RNTesterPage style change
Shawn Dempsey committedAug 10, 2022 Configuration menu - View commit details
-
Copy full SHA for 13ac427 - Browse repository at this point
Copy the full SHA 13ac427View commit details -
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedAug 10, 2022 Configuration menu - View commit details
-
Copy full SHA for a4d3720 - Browse repository at this point
Copy the full SHA a4d3720View commit details
Commits on Aug 17, 2022
-
Fix hit-testing in RCTTextView for selection
Summary: This fixes a regression introduced by D29340382 since the `contentView` of the window was changed to the `RCTRootView` instance. The problem isn't there though, but is due to now the `contentView` having flipped geometry. The `hitTest:` method expects coordinates in the superview's coordinate space: > A point that is in the coordinate system of the view’s superview, not of the view itself. Also see how `RCTTouchHandler` also calls `convertPoint:` on the `superview` before passing to `hitTest:` for the same reason: https://fburl.com/diffusion/krx4lxao Test Plan: {F628902534} Reviewers: lyahdav Reviewed By: lyahdav Subscribers: eliwhite Differential Revision: https://phabricator.intern.facebook.com/D29469639 Tasks: T94420821 Signature: 29469639:1625001662:97028699aee404282c83e35cd66f6308bc793a2a
Configuration menu - View commit details
-
Copy full SHA for 46606cd - Browse repository at this point
Copy the full SHA 46606cdView commit details -
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedAug 17, 2022 Configuration menu - View commit details
-
Copy full SHA for a4d20e0 - Browse repository at this point
Copy the full SHA a4d20e0View commit details
Commits on Aug 29, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedAug 29, 2022 Configuration menu - View commit details
-
Copy full SHA for 007317f - Browse repository at this point
Copy the full SHA 007317fView commit details
Commits on Sep 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 4a64054 - Browse repository at this point
Copy the full SHA 4a64054View commit details
Commits on Sep 9, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedSep 9, 2022 Configuration menu - View commit details
-
Copy full SHA for 7d3b7ee - Browse repository at this point
Copy the full SHA 7d3b7eeView commit details
Commits on Sep 12, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedSep 12, 2022 Configuration menu - View commit details
-
Copy full SHA for c3231cf - Browse repository at this point
Copy the full SHA c3231cfView commit details
Commits on Sep 14, 2022
-
Revert changes to touch handler
Shawn Dempsey committedSep 14, 2022 Configuration menu - View commit details
-
Copy full SHA for 0b7743a - Browse repository at this point
Copy the full SHA 0b7743aView commit details
Commits on Sep 15, 2022
-
Shawn Dempsey committed
Sep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 655c33a - Browse repository at this point
Copy the full SHA 655c33aView commit details -
Merge branch 'main' of github.com:microsoft/react-native-macos into t…
…ext-selection
Shawn Dempsey committedSep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for df41b3b - Browse repository at this point
Copy the full SHA df41b3bView commit details -
Merge branch 'text-selection' of github.com:shwanton/react-native-mac…
…os into text-selection
Shawn Dempsey committedSep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for bc083f9 - Browse repository at this point
Copy the full SHA bc083f9View commit details -
Shawn Dempsey committed
Sep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for 2364192 - Browse repository at this point
Copy the full SHA 2364192View commit details -
Re-add focus ring for selected text
Shawn Dempsey committedSep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for b08aae9 - Browse repository at this point
Copy the full SHA b08aae9View commit details -
Shawn Dempsey committed
Sep 15, 2022 Configuration menu - View commit details
-
Copy full SHA for b72d4bc - Browse repository at this point
Copy the full SHA b72d4bcView commit details
Commits on Sep 28, 2022
-
Ensure that RCTTextView manages the key loop view
Shawn Dempsey committedSep 28, 2022 Configuration menu - View commit details
-
Copy full SHA for eafbb5f - Browse repository at this point
Copy the full SHA eafbb5fView commit details -
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedSep 28, 2022 Configuration menu - View commit details
-
Copy full SHA for b13a21f - Browse repository at this point
Copy the full SHA b13a21fView commit details -
move focusable property lower in list
Shawn Dempsey committedSep 28, 2022 Configuration menu - View commit details
-
Copy full SHA for 948b162 - Browse repository at this point
Copy the full SHA 948b162View commit details -
Shawn Dempsey committed
Sep 28, 2022 Configuration menu - View commit details
-
Copy full SHA for 96421cb - Browse repository at this point
Copy the full SHA 96421cbView commit details
Commits on Oct 5, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedOct 5, 2022 Configuration menu - View commit details
-
Copy full SHA for a9b9d13 - Browse repository at this point
Copy the full SHA a9b9d13View commit details -
Remove iOS only highlighted prop that was causing re-render issues on…
… macOS
Shawn Dempsey committedOct 5, 2022 Configuration menu - View commit details
-
Copy full SHA for e8c32de - Browse repository at this point
Copy the full SHA e8c32deView commit details
Commits on Oct 11, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedOct 11, 2022 Configuration menu - View commit details
-
Copy full SHA for 42af687 - Browse repository at this point
Copy the full SHA 42af687View commit details
Commits on Oct 18, 2022
-
Merge remote-tracking branch 'microsoft/main' into text-selection
Shawn Dempsey committedOct 18, 2022 Configuration menu - View commit details
-
Copy full SHA for feb63ab - Browse repository at this point
Copy the full SHA feb63abView commit details -
Shawn Dempsey committed
Oct 18, 2022 Configuration menu - View commit details
-
Copy full SHA for 9f49a9c - Browse repository at this point
Copy the full SHA 9f49a9cView commit details