From c46a0c7e88523523fef5335705bb98aeceba9fe4 Mon Sep 17 00:00:00 2001 From: patrickhlauke Date: Fri, 2 Nov 2018 23:51:17 +0000 Subject: [PATCH] Replace touch-action: none with pan-y, remove preventDefault from touch event handling --- js/src/carousel.js | 3 --- scss/_carousel.scss | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/js/src/carousel.js b/js/src/carousel.js index 3c7e2b2d91..550c48eb55 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -283,14 +283,11 @@ class Carousel { if (this._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) { this.touchStartX = event.originalEvent.clientX } else if (!this._pointerEvent) { - event.preventDefault() this.touchStartX = event.originalEvent.touches[0].clientX } } const move = (event) => { - event.preventDefault() - // ensure swiping with one touch and not pinching if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { this.touchDeltaX = 0 diff --git a/scss/_carousel.scss b/scss/_carousel.scss index 97ce6a29cc..5e0949a92a 100644 --- a/scss/_carousel.scss +++ b/scss/_carousel.scss @@ -16,7 +16,7 @@ } .carousel.pointer-event { - touch-action: none; + touch-action: pan-y; } .carousel-inner {