diff options
author | Dave Z <dzaikos@users.noreply.github.com> | 2018-07-17 21:48:56 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@miniflux.net> | 2018-07-17 18:48:56 -0700 |
commit | 3f3174491103fc5a96b36918d8eada778f5b7210 (patch) | |
tree | 82a2e497ba2afc7e6b60e396dff5c8da64e94fc7 /ui/static/js | |
parent | 3b018bc6bf3b182b0ed24ee2956d0d7ef31ebb07 (diff) |
Prevent vertical scrolling on swipe
Diffstat (limited to 'ui/static/js')
-rw-r--r-- | ui/static/js/touch_handler.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/static/js/touch_handler.js b/ui/static/js/touch_handler.js index a6c5c81..d7ec359 100644 --- a/ui/static/js/touch_handler.js +++ b/ui/static/js/touch_handler.js @@ -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); }); |