Trying to get touch events working like they do with a regular SVG #2626
-
|
I am porting some React code over to React Native so that I can run it on a device and in the web. In my current code (below) I only let the user click the polyline with the mouse, not the entire SVG canvas, by use of the inline style pointerEvents: 'visiblePainted'. The goal of the app is to let the user select the SVG, but if they click the canvas outside of the polyline (but inside the SVG boundary) then I need to respond differently to the click of the background canvas. Current working React code: What I am experiencing in React Native is that the inline style doesn't have any effect. I can add an onPress event to the polyline itself though (current React Native code below) and that does only fire when they click the polyline, but if they click just outside it then the background image doesn't get the click event - it looks like the click is not propagated. React Native version: I have tried everything I can think of but it looks like there is no way of propagating the event. Has anyone got any ideas of what I could do? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Answered in #2633. |
Beta Was this translation helpful? Give feedback.
Answered in #2633.