Skip to content

Commit 56ab0f2

Browse files
committed
fix(gesture): only preventDefault on direction if direction supplied
1 parent e71fe0f commit 56ab0f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: js/utils/gestures.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,9 @@
11701170
this.preventedFirstMove = false;
11711171

11721172
} else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {
1173-
if (inst.options.prevent_default_directions.indexOf(ev.direction) != -1) {
1173+
// Prevent gestures that are not intended for this event handler from firing subsequent times
1174+
if (inst.options.prevent_default_directions.length === 0
1175+
|| inst.options.prevent_default_directions.indexOf(ev.direction) != -1) {
11741176
ev.srcEvent.preventDefault();
11751177
}
11761178
this.preventedFirstMove = true;

0 commit comments

Comments
 (0)