Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Commit

Permalink
Fixes touch functionality on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxxWyndham committed Oct 22, 2015
1 parent d168ac9 commit 80fbe8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dragula.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function dragula (initialContainers, options) {
release({});
return; // when text is selected on an input and then dragged, mouseup doesn't fire. this is our only hope
}
if (e.clientX === _moveX && e.clientY === _moveY) {
if (e.clientX !== void 0 && e.clientX === _moveX && e.clientY !== void 0 && e.clientY === _moveY) {
return;
}
if (o.ignoreInputTextSelection) {
Expand Down Expand Up @@ -502,6 +502,7 @@ function touchy (el, op, type, fn) {
}

function whichMouseButton (e) {
if (e.touches !== void 0) { return e.touches.length; }
if (e.buttons !== void 0) { return e.buttons; }
if (e.which !== void 0) { return e.which; }
var button = e.button;
Expand Down

0 comments on commit 80fbe8d

Please sign in to comment.