Open BrianWalters opened 3 years ago
up please
Hi @BrianWalters . I hope you are doing good. Were you able to figure out something. I am stuck in the same issue :)
For now, in your custom button/overlay add event.stopPropagation() like this:
function doTheThing(event) {
hackTheGibson();
event.stopPropagation();
alert("event propagation halted.");
}
buttonOverlay.addEventListener("dblclick", doTheThing);
https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation
But, yes we need an option to disable double click Zoom, something like this doubleClickZoom: false
panzoom(element, {
zoomDoubleClickSpeed: 1, // disables zoom on double click
});
Just like
beforeMouseDown
, we need a way to cancel the double click zoom event depending on the event context. For example, if we have buttons overlayed on the panzoom area, a user double-clicking a button shouldn't initiate a zoom.There is also no way I could see to disable the double click zoom entirely, if say someone created their own zoom in/out buttons, or maybe they want to implement some other function for a double click.