Skip to content

Panzoom toggle Gestures #860

Description

@eriksiemund

Is your feature request related to a problem? Please describe.

Hi!
Currently, it doesn't seem to be possible to disable the effects of gestures. There is the option "gestures", but this only allows to enable/disable them and this only at initialization.

Describe the solution you'd like

It would be great if there were a few flags that I could set in my code, that toggle the effects of certain gestures. In my specific use case, it would be great to disable panning unless the image scale is large enough to extend beyond either dimension. I have the panzoom instance inside a slider and would like the panning/dragging gesture to go though to the slider before that moment and be captured by panzoom once it's actually extending the container. I could also see other scenario, where I would like to enable or disable panning, pinching, scrolling etc. depending on the context to allow those gestures to be captured by the parent element.

Describe alternatives you've considered

I've tried using the gestures option, different combinations of pointer-events, touch-action and event.preventDefault, as well as switching between the 'mousemove' panMode and 'drag' depending on a condition. This was hacky but working as I would like it, but then again, it's drag by default on mobile so I couldn't go with this.

Additional context

Using panzoom v6.1.14

Many thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions