Skip to content

Conversation

hassankhan
Copy link
Contributor

@hassankhan hassankhan commented Jul 18, 2025

Corrects pointer-events: box-none behavior to match what's described at https://reactnative.dev/docs/view#pointerevents

Fixes #2606

Copy link

codesandbox-ci bot commented Jul 18, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 03c6a93:

Sandbox Source
react-native-web-examples Configuration

@hassankhan hassankhan marked this pull request as ready for review July 18, 2025 22:21
@hassankhan hassankhan changed the title [fix] Correctly propagate pointer-events to children when set to box-none [fix] Correctly propagate pointer-events: auto to children when set to box-none Jul 19, 2025
@hassankhan hassankhan force-pushed the @hassankhan/correctly-propagate-pointerevents branch from 605b413 to 5202ca7 Compare July 19, 2025 00:56
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 19, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying warning in the logs.x

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none` element from receiving pointer events is resolved by necolas/react-native-web#2789
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 19, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying
warning in the logs.

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none`
element from receiving pointer events is resolved by
necolas/react-native-web#2789

Fixes react-navigation#12441
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 19, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying
warning in the logs.

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none`
element from receiving pointer events is resolved by
necolas/react-native-web#2789

Fixes react-navigation#12441
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 19, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying
warning in the logs.

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none`
element from receiving pointer events is resolved by
necolas/react-native-web#2789

Fixes react-navigation#12441
… to `box-none`

Corrects `pointer-events: box-none` behavior to match what's described at https://reactnative.dev/docs/view#pointerevents

Fixes necolas#2606
@hassankhan hassankhan force-pushed the @hassankhan/correctly-propagate-pointerevents branch from 5202ca7 to 03c6a93 Compare July 19, 2025 23:25
@@ -176,6 +176,30 @@ describe('StyleSheet/compile', () => {
]
`);
});

Copy link
Contributor Author

@hassankhan hassankhan Jul 21, 2025

Choose a reason for hiding this comment

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

Happy to remove the test if the maintainer(s) think the snapshot test above suffices

@necolas necolas closed this in e76a17d Jul 25, 2025
@hassankhan hassankhan deleted the @hassankhan/correctly-propagate-pointerevents branch July 26, 2025 03:03
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 29, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying
warning in the logs.

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none`
element from receiving pointer events is resolved by
necolas/react-native-web#2789

Fixes react-navigation#12441
hassankhan added a commit to hassankhan/react-navigation that referenced this pull request Jul 29, 2025
By replacing usages of `pointerEvents` to use styles instead of props, we won't get an annoying
warning in the logs.

The underlying issue in React Native Web which prevented children of a `pointer-events: box-none`
element from receiving pointer events is resolved by
necolas/react-native-web#2789

Fixes react-navigation#12441
satya164 pushed a commit to react-navigation/react-navigation that referenced this pull request Aug 2, 2025
BREAKING CHANGE: the minimum required version for `react-native-web` is now `~0.21.0`

**Motivation**

By replacing usages of `pointerEvents` to use styles instead of props,
we won't get an annoying warning in the logs.

The underlying issue in React Native Web which prevented children of a
`pointer-events: box-none` element from receiving pointer events is
resolved by necolas/react-native-web#2789.

A follow-up fix to React Native Testing Library was also required, PR
here
callstack/react-native-testing-library#1799.

Fixes #12441

**Test plan**

CI (unit + E2E)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pointer event is not applied for grand-children
1 participant