-
Notifications
You must be signed in to change notification settings - Fork 296
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
onclick events in svg stop working #59
Comments
same |
Same. It's unfortunate. It's a good library, but I need to be able to attach other functionality to the sub-components of the SVG, and this seems to prevent that. |
See here to handle event bubbling with this library. Good to know in general: #107 |
@rbonomo I'm aware of https://codesandbox.io/s/condescending-antonelli-qx5p3 It seems though, that if you attach your event to the object in the vanilla javascript way with Do you have any idea why it would be the case that it wouldn't work doing it the React way, but it would work doing it the vanilla js way? EDIT I should clarify, the real issue I'm talking about is that the |
@vincerubinetti Yeah man get outta React world for a sec and just do event.stopPropagation() in vanilla JS. I stopped using React myself and just use regular JS now so I can't really help you out there. Maybe it's because you're using React events? And the native event methods such as stopPropagation() are not in React events? Or are handled differently? You've put yourself into a whole different world by using React. For what? |
React is used by millions of developers... You'd do well to make sure your library is compatible with it.
I'm not going to discuss the benefits of React here, but briefly: Because I'm building a large application that it would be impractical to build in vanilla javascript, which I have used for almost a decade before I started using React. Take the advice or leave it (as you seem to want to). |
It would be impractical without a component design model. React forces good design patterns. That's the benefit.
|
When using panzoom.js onclick events in svgs are intercepted by panzoom and not passed to the interactive svg.
The text was updated successfully, but these errors were encountered: