Skip to content
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

Cannot click objects in SVG when svg-pan-zoom is enabled #463

Open
Kevijeps opened this issue Jan 23, 2025 · 1 comment
Open

Cannot click objects in SVG when svg-pan-zoom is enabled #463

Kevijeps opened this issue Jan 23, 2025 · 1 comment

Comments

@Kevijeps
Copy link

Greetings
Working on an implementation of using pan-zoom on a network map.
There are objects with IDs inside the SVG that when "clicked" open a data card about the object as a popover.
This works great with or without pan-zoom as long as the clicks are being done with a mouse.
On mobile devices touch events work on the SVG but don't when pan-zoom is loaded.
The SVG is loaded into the main webpage as an object.
Is there anyway to make the touch events activate the objects?
It looks like the controls for pan-zoom take priority somehow.
Thanks for your help.

@dmayerdesign
Copy link

I think I figured it out -- looks like the option you're looking for is preventMouseEventsDefault.

After setting that to false, the click handlers I have on my path elements are now firing.

However, what's also happening now is it's zooming whenever I single-click anywhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants