-
Notifications
You must be signed in to change notification settings - Fork 292
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
onTouch to have behavior like beforeMouseDown #194
Comments
a huge +1 @exrhizo did you find a solution? |
Ha, I looked into the code and found a solution! Simply add event listeners to the DOM element where you use PanZoom and trigger .pause() on your desired condition on let $page = document.getElementById("mp-sheet");
$page.addEventListener("touchstart", (e) => {
if (e.target.closest(".block")) PanZoom.pause();
});
$page.addEventListener("touchend", (e) => {
PanZoom.resume();
});
PanZoom = panzoom($page, { ... }); |
@BernhardBaumrock THANK YOU!!! I almost gave up on using this library because I couldn't figure out how to stop touch-based panning. |
Is there a way to modify this so it only pauses panning, but still allows zoom? |
@stealsocks is your case similar to what @lindsaywebstudio was asking? How did you do it? |
Hi,
I am using beforeMouseDown bypass panzoom when dragging an element, I want to be able to have the same behavior in onTouch.
Currently:
Could something similar be done for onTouch?
It is possible to have not just event propogation, but selective disabling of the gesture?
Thank you for the code, I'm forking something here to cover my use case :)
This seems related to:
#12
The semantics of beforeMouseDown and beforeTouch are different, I can imagine that changing this could be breaking, otherwise I would create a pull request
The text was updated successfully, but these errors were encountered: