Skip to content

Commit

Permalink
Replace touch-action: none with pan-y, remove preventDefault from tou…
Browse files Browse the repository at this point in the history
…ch event handling
  • Loading branch information
patrickhlauke authored and XhmikosR committed Nov 4, 2018
1 parent 9cc237d commit c46a0c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scss/_carousel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}

.carousel.pointer-event {
touch-action: none;
touch-action: pan-y;
}

.carousel-inner {
Expand Down

0 comments on commit c46a0c7

Please sign in to comment.