Skip to content

Commit

Permalink
[dd] Prevent default on gesturemovestart after movement has started.
Browse files Browse the repository at this point in the history
gesturemovestart is actually triggered on gesturestart/mousedown rather
than on the start of movement. It then throttles down based on a mintime or
min movement. We therefore need to move the preventDefault down to the
function it throttles otherwise we prevent on mousedown of non-dragged
object too.
  • Loading branch information
andrewnicols authored and tilomitra committed Apr 8, 2014
1 parent 7add823 commit 9f96abc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/dd/js/drag-gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {
minDistance: this.get('clickPixelThresh'),
minTime: this.get('clickTimeThresh'),
preventDefault: true
minTime: this.get('clickTimeThresh')
});

node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });
Expand Down
1 change: 1 addition & 0 deletions src/dd/js/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@
* @param {EventFacade} ev The Event
*/
_handleMouseDownEvent: function(ev) {
ev.preventDefault();
this.fire(EV_MOUSE_DOWN, { ev: ev });
},
/**
Expand Down

0 comments on commit 9f96abc

Please sign in to comment.