Skip to content

Commit

Permalink
fix incorrect touch action pan direction
Browse files Browse the repository at this point in the history
if i want to intercept/handle horizontal pans/swipes, i need `pan-y`,
not `pan-x` (as touch-action determines which default actions the
browser should handle - if i wanted to do my own horizontal pans/swipes,
i DON'T want the browser to handle `pan-x`). the fact that this code
seems to currently work regardless may be due to other logic in the
script, like the part where `touch-action` is combined...
  • Loading branch information
patrickhlauke committed Oct 7, 2015
1 parent fdae07b commit a81da57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/recognizers/pan.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ inherit(PanRecognizer, AttrRecognizer, {
var direction = this.options.direction;
var actions = [];
if (direction & DIRECTION_HORIZONTAL) {
actions.push(TOUCH_ACTION_PAN_X);
actions.push(TOUCH_ACTION_PAN_Y);
}
if (direction & DIRECTION_VERTICAL) {
actions.push(TOUCH_ACTION_PAN_Y);
actions.push(TOUCH_ACTION_PAN_X);
}
return actions;
},
Expand Down

0 comments on commit a81da57

Please sign in to comment.