panzoom icon indicating copy to clipboard operation
panzoom copied to clipboard

beforeMouseDown never triggered

Open cvharris opened this issue 5 years ago • 6 comments

I'm not sure why but the beforeMouseDown function is never called. I even tried adding it to the SVG Tiger JSFiddle and it was never fired.

Since I can't actually filter the mouse events for panning I can't customize its behavior in my app.

cvharris avatar Dec 16 '19 21:12 cvharris

Same here. This is breaking because it prevents me from disabling panning (I only need pinching).

tommedema avatar Dec 22 '19 01:12 tommedema

Same here. I used panzoom for vue draggable tree and it's mess when dragging elements and panning. Then I use beforeMouseDown and it doesn't call.

jr-suraj avatar Jan 20 '20 04:01 jr-suraj

Can you guys put a working example like Jsfiddle ?

navneetsingh-cpu avatar Feb 12 '20 19:02 navneetsingh-cpu

@dota2Pro like following code beforeZoom work well while press Alt key but beforeMouseDown not triggered `

beforeWheel: function(e) { // allow wheel-zoom only if altKey is down. Otherwise - ignore var shouldIgnore = !e.altKey; return shouldIgnore; }, beforeMouseDown: function(e) { var shouldIgnore = !e.altKey; return shouldIgnore; },`

jr-suraj avatar Feb 14 '20 08:02 jr-suraj

i'm working in a similar way as @jr-suraj and I found out the way the event works:

In the very moment you push the mouse button the event is triggered, but when you keep moving it doesn't call the event once again.

If you want to use the event to stop dragging the panzoom element and start dragging other elements inside, you should check first in the event that the element is being clicked. This way I can move elements inside panzoom without moving the panzoom element.

jonanvc avatar Feb 21 '20 10:02 jonanvc

I found that if I close the debugger window of the browser it works.

davidbcoulson avatar Jan 10 '22 02:01 davidbcoulson