Skip to content

Commit

Permalink
chore: remove multitouch condition
Browse files Browse the repository at this point in the history
  • Loading branch information
nolimits4web committed Sep 29, 2023
1 parent 902a4c4 commit 7b21583
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/events/onTouchMove.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default function onTouchMove(event) {
const id = e.pointerId;
if (id !== data.pointerId) return;
}

let targetTouch;
if (e.type === 'touchmove') {
targetTouch = [...e.changedTouches].filter((t) => t.identifier === data.touchId)[0];
Expand All @@ -40,6 +41,7 @@ export default function onTouchMove(event) {
touches.startY = pageY;
return;
}

if (!swiper.allowTouchMove) {
if (!e.target.matches(data.focusableElements)) {
swiper.allowClick = false;
Expand All @@ -55,6 +57,7 @@ export default function onTouchMove(event) {
}
return;
}

if (params.touchReleaseOnEdges && !params.loop) {
if (swiper.isVertical()) {
// Vertical
Expand All @@ -73,17 +76,18 @@ export default function onTouchMove(event) {
return;
}
}

if (document.activeElement) {
if (e.target === document.activeElement && e.target.matches(data.focusableElements)) {
data.isMoved = true;
swiper.allowClick = false;
return;
}
}

if (data.allowTouchCallbacks) {
swiper.emit('touchMove', e);
}
if (e.targetTouches && e.targetTouches.length > 1) return;

touches.previousX = touches.currentX;
touches.previousY = touches.currentY;
Expand Down

0 comments on commit 7b21583

Please sign in to comment.