Skip to content

Commit

Permalink
Revert "Removed preventDefault statements from handlers of passive ev…
Browse files Browse the repository at this point in the history
…ents: onTouchMove, onTouchStart"

This reverts commit cc5341f.
  • Loading branch information
MertTurel committed Jan 24, 2021
1 parent cc5341f commit 6e121d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/innerSliderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {};
Expand Down Expand Up @@ -420,6 +421,7 @@ export const swipeMove = (e, spec) => {
}
if (touchObject.swipeLength > 10) {
state["swiping"] = true;
e.preventDefault();
}
return state;
};
Expand Down

0 comments on commit 6e121d2

Please sign in to comment.