Skip to content

Commit bb3a562

Browse files
committed
empty sortable detection on touch move
1 parent 41fd3e4 commit bb3a562

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sortable.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@
462462
}, true);
463463

464464
var nearestEmptyInsertDetectEvent = function(evt) {
465+
evt = evt.touches ? evt.touches[0] : evt;
465466
if (dragEl) {
466467
var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
467468

@@ -476,8 +477,9 @@
476477
}
477478
};
478479
// We do not want this to be triggered if completed (bubbling canceled), so only define it here
479-
document.addEventListener('dragover', nearestEmptyInsertDetectEvent);
480-
document.addEventListener('mousemove', nearestEmptyInsertDetectEvent);
480+
_on(document, 'dragover', nearestEmptyInsertDetectEvent);
481+
_on(document, 'mousemove', nearestEmptyInsertDetectEvent);
482+
_on(document, 'touchmove', nearestEmptyInsertDetectEvent);
481483

482484
/**
483485
* @class Sortable

0 commit comments

Comments
 (0)