Skip to content
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: Added pointerEvents style equivalent to pointerEvents prop #34586

Closed

Conversation

cyrus25
Copy link
Contributor

@cyrus25 cyrus25 commented Sep 3, 2022

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-bot facebook-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-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Sep 3, 2022
@facebook-github-bot facebook-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
Copy link

analysis-bot commented Sep 3, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,634,874 -1,766
android hermes armeabi-v7a 7,046,666 -1,967
android hermes x86 7,936,737 -1,870
android hermes x86_64 7,908,577 -2,063
android jsc arm64-v8a 9,512,188 -739
android jsc armeabi-v7a 8,287,495 -727
android jsc x86 9,451,757 -726
android jsc x86_64 10,042,992 -726

Base commit: 12e5842
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 12e5842
Branch: main

@facebook-github-bot
Copy link
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
Collaborator

This pull request was successfully merged by @cyrus25 in 5c109b3.

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

@react-native-bot react-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
Contributor

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
Contributor

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
Contributor Author

cyrus25 commented Sep 5, 2022

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
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…ook#34597)

Summary:
Make style pointerEvents take priority over pointerEvents prop. Fixes requested changes in facebook#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 facebook#34586

Pull Request resolved: facebook#34597

Test Plan: Will rely on green cli

Reviewed By: NickGerleman

Differential Revision: D39269306

Pulled By: cipolleschi

fbshipit-source-id: 0927bf6ad7e3ac63e82dbd1a873532152f29001d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants