Skip to content

Commit

Permalink
Don't call onDrag when multiple fingers are touching the map
Browse files Browse the repository at this point in the history
Calling onDrag when multiple fingers are touching the map causes a delay
when you start pinch zooming. This is because the pinch is interpreted
as a tap in the beginning, which causes stopPropagation to be called.

I think dragging is an action you only do with one finger, so therefore
I think not calling onDrag is the correct solution to this.

Fixes mapbox#962
  • Loading branch information
trygveaa committed Mar 18, 2020
1 parent 405e3bf commit a290ccc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ export default function(ctx) {
}

currentMode.touchmove(event);
return events.touchdrag(event);

if (event.points.length === 1) {
events.touchdrag(event);
}
};

events.touchend = function(event) {
Expand Down

0 comments on commit a290ccc

Please sign in to comment.