mirror of
https://github.com/twbs/bootstrap.git
synced 2022-11-09 12:25:43 -05:00
Replace touch-action: none with pan-y, remove preventDefault from touch event handling
This commit is contained in:
parent
9cc237d0ba
commit
c46a0c7e88
2 changed files with 1 additions and 4 deletions
|
@ -283,14 +283,11 @@ class Carousel {
|
||||||
if (this._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
|
if (this._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
|
||||||
this.touchStartX = event.originalEvent.clientX
|
this.touchStartX = event.originalEvent.clientX
|
||||||
} else if (!this._pointerEvent) {
|
} else if (!this._pointerEvent) {
|
||||||
event.preventDefault()
|
|
||||||
this.touchStartX = event.originalEvent.touches[0].clientX
|
this.touchStartX = event.originalEvent.touches[0].clientX
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const move = (event) => {
|
const move = (event) => {
|
||||||
event.preventDefault()
|
|
||||||
|
|
||||||
// ensure swiping with one touch and not pinching
|
// ensure swiping with one touch and not pinching
|
||||||
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
|
||||||
this.touchDeltaX = 0
|
this.touchDeltaX = 0
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.carousel.pointer-event {
|
.carousel.pointer-event {
|
||||||
touch-action: none;
|
touch-action: pan-y;
|
||||||
}
|
}
|
||||||
|
|
||||||
.carousel-inner {
|
.carousel-inner {
|
||||||
|
|
Loading…
Reference in a new issue