TouchableOpacity inside SVG not clickable
See original GitHub issueHello all,
I have an issue where TouchableOpacity
doesn’t trigger onPress
events when it’s nested inside svg
element. For same feature, I have different implementation where TouchableOpacity
on Android is outside svg
element and it registers tap just fine. As soon as it’s inside header it just stops working.
react-native-svg: "7.0.3."
Any ideas? Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9
Top Results From Across the Web
TouchableOpacity inside SVG not clickable #826 - GitHub
Hello all,. I have an issue where TouchableOpacity doesn't trigger onPress events when it's nested inside svg element.
Read more >Touchable opacity on press not working inside SVG tags
The reason for that is that SVG is at the top as parent element, disabling the accessibility to TouchableOpacity . This means the...
Read more >Touchable opacity on press not working inside SVG tags ...
The reason for that is that SVG is at the top as parent element, disabling the accessibility to TouchableOpacity . This means the...
Read more >ReactNative: using SVG as a button - Krasimir Tsonev
Using an SVG as a button is one of them. Find my solution below and expect more ... The transparent bits of the...
Read more >Is there a way to do a touchableOpacity button without ... - Reddit
I am trying to do a circular button using touchableOpacity in react native, ... of the rectangle remain clickable, which is not what...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t think we’ve had support for that yet. Would be nice to have though. You can use onPress directly on the svg elements for now, or isolate the part you want touchable to animate in a separate svg root which you wrap with touchable. This will allow it to just change the opacity of the already rendered svg, rather than re-render its content each frame of the animation.
Hello @msand, any update on this?