Skip to content

Commit c46a0c7

Browse files
patrickhlaukeXhmikosR
authored andcommitted
Replace touch-action: none with pan-y, remove preventDefault from touch event handling
1 parent 9cc237d commit c46a0c7

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

js/src/carousel.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,11 @@ class Carousel {
283283
if (this._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
284284
this.touchStartX = event.originalEvent.clientX
285285
} else if (!this._pointerEvent) {
286-
event.preventDefault()
287286
this.touchStartX = event.originalEvent.touches[0].clientX
288287
}
289288
}
290289

291290
const move = (event) => {
292-
event.preventDefault()
293-
294291
// ensure swiping with one touch and not pinching
295292
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
296293
this.touchDeltaX = 0

scss/_carousel.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
.carousel.pointer-event {
19-
touch-action: none;
19+
touch-action: pan-y;
2020
}
2121

2222
.carousel-inner {

0 commit comments

Comments
 (0)