Skip to content

feat: add userSelect style equivalent to selectable - #34575

Closed
dakshbhardwaj wants to merge 3 commits into
react:mainfrom
dakshbhardwaj:feat/add-userSelect-prop
Closed

feat: add userSelect style equivalent to selectable#34575
dakshbhardwaj wants to merge 3 commits into
react:mainfrom
dakshbhardwaj:feat/add-userSelect-prop

Conversation

@dakshbhardwaj

Copy link
Copy Markdown
Contributor

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 style

Test Plan

  • open the RNTester app and navigate to the Text page
  • Check the Selectable Text through the Selectable text section

@facebook-github-botfacebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Sep 2, 2022
@react-native-botreact-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Sep 2, 2022
@analysis-bot

analysis-bot commented Sep 2, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
ios-universaln/a--

Base commit: 12e5842
Branch: main

@analysis-bot

analysis-bot commented Sep 2, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a7,636,773+133
androidhermesarmeabi-v7a7,048,766+133
androidhermesx867,938,732+125
androidhermesx86_647,910,754+114
androidjscarm64-v8a9,513,118+191
androidjscarmeabi-v7a8,288,416+194
androidjscx869,452,660+177
androidjscx86_6410,043,906+188

Base commit: 12e5842
Branch: main

let style = restProps.style;

let _selectable = restProps.selectable;
if (style && style.userSelect !== undefined) {

Copy link
Copy Markdown

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

Copy link
Copy Markdown
ContributorAuthor

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

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jacdebug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @dakshbhardwaj in fc42d5b.

When will my fix make it into a release? | Upcoming Releases

@react-native-botreact-native-bot added the Merged This PR has been merged. label Sep 8, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.MergedThis PR has been merged.Needs TypeScript UpdateShared with MetaApplied via automation to indicate that an Issue or Pull Request has been shared with the team.Type: EnhancementA new feature or enhancement of an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@dakshbhardwaj@analysis-bot@facebook-github-bot@react-native-bot@necolas@jacdebug