diff --git a/src/Sortable.js b/src/Sortable.js index 81ff84494..21386b10e 100644 --- a/src/Sortable.js +++ b/src/Sortable.js @@ -696,6 +696,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } else { on(document, 'mousemove', this._onTouchMove); } + on(document, 'touchmove', this._preventTouchMove); } else { on(dragEl, 'dragend', this); on(rootEl, 'dragstart', this._onDragStart); @@ -849,6 +850,12 @@ Sortable.prototype = /** @lends Sortable.prototype */ { } }, + _preventTouchMove: function (/**TouchEvent*/evt) { + if (evt.cancelable) { + evt.preventDefault(); + } + }, + _appendGhost: function () { // Bug if using scale(): https://stackoverflow.com/questions/2637058 // Not being adjusted for @@ -1322,6 +1329,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ { off(document, 'mousemove', this._onTouchMove); off(document, 'touchmove', this._onTouchMove); off(document, 'pointermove', this._onTouchMove); + off(document, 'touchmove', this._preventTouchMove); off(document, 'dragover', nearestEmptyInsertDetectEvent); off(document, 'mousemove', nearestEmptyInsertDetectEvent); off(document, 'touchmove', nearestEmptyInsertDetectEvent); @@ -1934,7 +1942,7 @@ function _cancelNextTick(id) { } // Fixed #973: -if (documentExists) { +if (documentExists && (FireFox || Safari)) { on(document, 'touchmove', function(evt) { if ((Sortable.active || awaitingDragStarted) && evt.cancelable) { evt.preventDefault(); @@ -1942,7 +1950,6 @@ if (documentExists) { }); } - // Export utils Sortable.utils = { on,