Skip to content

Commit

Permalink
fix(gesture): only preventDefault on direction if direction supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
perrygovier committed May 20, 2015
1 parent e71fe0f commit 56ab0f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/utils/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,9 @@
this.preventedFirstMove = false;

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

0 comments on commit 56ab0f2

Please sign in to comment.