Skip to content

feat: Added pointerEvents style equivalent to pointerEvents prop - #34586

Closed
cyrus25 wants to merge 3 commits into
react:mainfrom
cyrus25:feat/add-pointer-events-style-property
Closed

feat: Added pointerEvents style equivalent to pointerEvents prop#34586
cyrus25 wants to merge 3 commits into
react:mainfrom
cyrus25:feat/add-pointer-events-style-property

Conversation

@cyrus25

@cyrus25cyrus25 commented Sep 3, 2022

Copy link
Copy Markdown
Contributor

Summary

This adds pointerEvents style which is equivalent to pointerEvents prop as requested in #34425

Changelog

[General] [Added] - Added pointerEvents style equivalent to pointerEvents prop

Test Plan

<View
style={{
pointerEvents: 'none'
}}
>
</View> 

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

analysis-bot commented Sep 3, 2022

Copy link
Copy Markdown
PlatformEngineArchSize (bytes)Diff
androidhermesarm64-v8a7,634,874-1,766
androidhermesarmeabi-v7a7,046,666-1,967
androidhermesx867,936,737-1,870
androidhermesx86_647,908,577-2,063
androidjscarm64-v8a9,512,188-739
androidjscarmeabi-v7a8,287,495-727
androidjscx869,451,757-726
androidjscx86_6410,042,992-726

Base commit: 12e5842
Branch: main

@analysis-bot

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

Base commit: 12e5842
Branch: main

@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 @cyrus25 in 5c109b3.

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 5, 2022
forwardedRef,
) => {
const flattendStyle = flattenStyle(style);
const newPointerEvents = pointerEvents || flattendStyle?.pointerEvents;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We probably should have made the style take priority

{tabIndex, focusable, style, pointerEvents, ...otherProps}: ViewProps,
forwardedRef,
) => {
const flattendStyle = flattenStyle(style);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

flattendStyle => flattenedStyle

@cyrus25

Copy link
Copy Markdown
ContributorAuthor

Hi @necolas, thanks for reviewing the PR, I've made the requested changes here #34597

facebook-github-bot pushed a commit that referenced this pull request Sep 6, 2022
Summary:
Make style pointerEvents take priority over pointerEvents prop. Fixes requested changes in #34586
## Changelog
<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->
[General] [Fixed] - Make style pointerEvents take priority over pointerEvents prop. FIxes requested changes in #34586
Pull Request resolved: #34597
Test Plan: Will rely on green cli
Reviewed By: NickGerleman
Differential Revision: D39269306
Pulled By: cipolleschi
fbshipit-source-id: 0927bf6ad7e3ac63e82dbd1a873532152f29001d
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.Shared 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.

5 participants

@cyrus25@analysis-bot@facebook-github-bot@react-native-bot@necolas