-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
Gestures don't work with sub-components of react-native-svg's <Svg> on iOS #2734
Comments
Hi @chriscoomber! The code in issue that you've mentioned still works. There's just one difference that makes it work. In the linked issue there is: <GestureDetector key={key} gesture={tapGesture}>
<Path d={path} onResponderMove={(_) => {}} />
</GestureDetector> while in your case there's: <GestureDetector gesture={tapGesture}>
<Path d={path} fill={fill} />
</GestureDetector> Now, adding For now I'm not sure why it happens, but I'll definitely investigate that! |
I'll close it later because I want to dive into it and see why it works. |
Okay, I've looked more into this problem, together with @jakex7, and it seems that the problem lies in the fact that There's nothing more that we can do this on Gesture Handler side so I'm closing this issue. |
Description
Wrapping SVG sub-components with
<GestureDetector>
doesn't seem to work.(There is a related issue, #2502, which was resolved. However, the code presented in the solution doesn't work any more. This indicates to me that this did work at some point, but doesn't seem to any more.)
Naturally, this could be a react-native-svg issue.
Steps to reproduce
Attempt to wrap an SVG sub-component, such as
Path
, in aGestureDetector
:Expected result: clicking the square causes it to change color, but clicking anywhere else does nothing. Should work on Android and iOS.
Actual result: Works on web, via react-native-web. Also works on Android.
Does not work on iOS.
Snack or a link to a repository
https://github.com/chriscoomber/RNSvg-gesture-handler-repro
I also made a snack, though it is muddied by software-mansion/react-native-svg#2214 which makes it crash on android/iOS.
https://snack.expo.dev/@chris_whiterosemaths/interactive-svg-component
Gesture Handler version
2.12.1
React Native version
0.72.6
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: