From 6e121d24484a9ff89a066f877d4c35f360b7e6c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20Tu=CC=88rel?= Date: Sun, 24 Jan 2021 20:08:38 +0300 Subject: [PATCH] Revert "Removed preventDefault statements from handlers of passive events: onTouchMove, onTouchStart" This reverts commit cc5341f28c800c2b33ff033e2e845d4fb50d4243. --- src/utils/innerSliderUtils.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/innerSliderUtils.js b/src/utils/innerSliderUtils.js index 31e95c963..9c8465276 100644 --- a/src/utils/innerSliderUtils.js +++ b/src/utils/innerSliderUtils.js @@ -316,7 +316,7 @@ export const keyHandler = (e, accessibility, rtl) => { }; export const swipeStart = (e, swipe, draggable) => { - e.target.tagName === "IMG"; + e.target.tagName === "IMG" && e.preventDefault(); if (!swipe || (!draggable && e.type.indexOf("mouse") !== -1)) return ""; return { dragging: true, @@ -352,6 +352,7 @@ export const swipeMove = (e, spec) => { listWidth } = spec; if (scrolling) return; + if (animating) return e.preventDefault(); if (vertical && swipeToSlide && verticalSwiping) e.preventDefault(); let swipeLeft, state = {}; @@ -420,6 +421,7 @@ export const swipeMove = (e, spec) => { } if (touchObject.swipeLength > 10) { state["swiping"] = true; + e.preventDefault(); } return state; };