You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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.
All reactions