-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Android] Pointer Events box-none not working after react-native 66 #1807
Comments
Version 13 seems to introduce a breaking issue - I rolled back to 12.4.4 and all is fine again. |
That's very strange. This bug was filed before version 13. All the tests were made using version 12.4.4. Are you sure you did not revert the react-native version to a version lower than 66? |
I was working on my project and was having trouble with a rendering issue which turned out to be me populating the path with the wrong values, and while doing that, the path d value was no longer being set (I was doing this via native props from RN reanimated). Upgraded from 12.4.4 to 13.0 and the path was no longer visible and the touch events weren't passing through, so I rolled back again to 12.4.4 and it was all fine. |
There are so many weird issues combining these libraries anyway |
Got it @marksyzm. Seems like a different issue though. This one is about only having events in the SVG painted areas with the usage of the pointerEvents box-none. |
There is a regression that came with v13 of this library, it looks like a bug in the implementation of |
@labmorales did passing |
This PR is a bug fix and makes the pointer-events box-none work again after react-native 66 changes. It changes a bit how it should be used as I'll describe below. This solves #1807 . I created a getHitSlopRect in the RenderableView that responds with a Rect that make the hit test detection fail on the react-native forcing it to run reactTagForTouch like it used to in previous versions. This PR impacts pointer events box-none usage. This is an important change for me because it enables the usage of overlapping SVG keeping only the painted area as touchable elements, and not the whole SVG box.
Bug
Before react-native 66 pointer events, box-none worked as expected on Android. It preserved the interactive area to the actual area that was painted. After the update made in react native 66 (https://reactnative.dev/blog/2021/10/01/version-066 more specifically https://github.com/facebook/react-native/pull/29039/files) that stopped working.
That can be seen on the snacks below when trying to select the blue section behind the red section. Before react native 66 you can do that and after the blue section can only be selected outside the box of the red section.
Working on react-native 64
https://snack.expo.dev/@amorales85/react-native-svg---box_none-working
Not working on react-native 68
https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly
Unexpected behavior
Working on react-native 64
https://snack.expo.dev/@amorales85/react-native-svg---box_none-working
Not working on react-native 68
https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly
Environment info
React native info output:
Library version: 12.4.0
Steps To Reproduce
Can see the issue happening in this snack:
https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly that usese react-native 68.
Short, Self Contained, Correct (Compilable), Example
N/A I think.
The text was updated successfully, but these errors were encountered: