question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

panzoom prevents developer's double click events in the app

See original GitHub issue

First of all thanks for making such a great plugin!

The following is the code I am using,

        // just grab any DOM element
        var area = document.querySelector('.faqdesigner');

        // And pass it to panzoom
        panzoom(area, {
            zoomDoubleClickSpeed: 1
        });

        // this is the double click event
        $('.appcontainer').on('dblclick', '.faqnode', onNodeDblClick);

but double click on elements is not firing because of panzoom plugin, so I investigated and checked the source code, I see a lot of

e.preventDefault();
e.stopPropagation();

even inside function onDoubleClick(e) { ... } which I commented and my double click event gets fired

it is restricting and interfering with the developers code, it may be nice to have it configurable like switch on or off through plugin settings

could you please have a look

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
navneetsingh-cpucommented, Jul 2, 2019

panzoom appears to still handle the double click as a zoom though… as far as I can tell there does not seem to be a way to disable the zoom-on-double-click feature

panzoom(element, {
  zoomDoubleClickSpeed: 1, 
});

Disables Double click zoom

4reactions
anvakacommented, Oct 19, 2018

Thank you for the suggestion!

Starting from v6.3.0, you can do this by passing onDoubleClick(e) event handler that returns false:

panzoom(document.getElementById('g4'), {
  onDoubleClick: function(e) {
    // `e` - is current double click event.

    return false; // tells the library to not preventDefault, and not stop propagation
  }
});

Please let me know if this works for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

svg.js / svg-pan-zoom - doubleclick interactions - Stack Overflow
According to my debugging, it looks like sometimes when my app loads, the doubleclick function I wrote is called twice for each doubleclick....
Read more >
panzoom - npm
By default panzoom will prevent default action on double click events - this is done to avoid accidental text selection (which is default ......
Read more >
@varsitysoftware/ngx-panzoom - NPM Package Overview - Socket
The number of zoom levels to zoom on double click. zoomStepDuration, number, 0.2, Number of seconds to animate between two adjacent zoom levels....
Read more >
jQuery.panzoom - JavaScripting.com
It uses pointer events by default wherever supported. SVG support. Panzoom supports panning and zooming SVG elements directly. In IE11, CSS animations/ ...
Read more >
allowsCameraControl | Apple Developer Documentation
If you set this property to true , SceneKit creates a camera node and handles mouse or touch events to allow the user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found