1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Prevent vertical scrolling on swipe

This commit is contained in:
Dave Z 2018-07-17 21:48:56 -04:00 committed by Frédéric Guillot
parent 3b018bc6bf
commit 3f31744911
2 changed files with 6 additions and 4 deletions

View file

@ -60,6 +60,8 @@ class TouchHandler {
this.touch.element.style.opacity = opacity;
this.touch.element.style.transform = "translateX(" + tx + "px)";
event.preventDefault();
}
}
@ -87,7 +89,7 @@ class TouchHandler {
elements.forEach((element) => {
element.addEventListener("touchstart", (e) => this.onTouchStart(e), hasPassiveOption ? { passive: true } : false);
element.addEventListener("touchmove", (e) => this.onTouchMove(e), hasPassiveOption ? { passive: true } : false);
element.addEventListener("touchmove", (e) => this.onTouchMove(e), hasPassiveOption ? { passive: false } : false);
element.addEventListener("touchend", (e) => this.onTouchEnd(e), hasPassiveOption ? { passive: true } : false);
element.addEventListener("touchcancel", () => this.reset(), hasPassiveOption ? { passive: true } : false);
});