-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
feat: add userSelect style equivalent to selectable #34575
feat: add userSelect style equivalent to selectable #34575
Conversation
Base commit: 12e5842 |
Base commit: 12e5842 |
@@ -153,6 +153,16 @@ const Text: React.AbstractComponent< | |||
: processColor(restProps.selectionColor); | |||
|
|||
let style = restProps.style; | |||
|
|||
let _selectable = restProps.selectable; | |||
if (style && style.userSelect !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style needs to be flattened as it could be an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@necolas i have pushed the changes
@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @dakshbhardwaj in fc42d5b. When will my fix make it into a release? | Upcoming Releases |
Summary: This adds support for the `userSelect` style attribute, mapping the already existing selectable attribute as requested on facebook#34425. This PR also updates the TextExample.android and TestExample.ios on the RNTester in order to facilitate the manual QA of this. ## Changelog [General] [Added] - Add support for `userSelect` style Pull Request resolved: facebook#34575 Test Plan: - open the RNTester app and navigate to the Text page - Check the `Selectable Text` through the Selectable text section <Image src="https://user-images.githubusercontent.com/22423684/188112863-65acd145-76b0-47ba-8bc6-f72298077096.png" height="600" width="300" /> Reviewed By: yungsters Differential Revision: D39252798 Pulled By: jacdebug fbshipit-source-id: f7fabf20ee68778d75461f511c56f94d0d756d9c
Summary
This adds support for the
userSelect
style attribute, mapping the already existing selectable attribute as requested on #34425. This PR also updates the TextExample.android and TestExample.ios on the RNTester in order to facilitate the manual QA of this.Changelog
[General] [Added] - Add support for
userSelect
styleTest Plan
Selectable Text
through the Selectable text section