Skip to content

Commit

Permalink
🐞 Add innocuous handler to fix iOS 10 scroll
Browse files Browse the repository at this point in the history
Ref #457
  • Loading branch information
desandro committed Oct 18, 2016
1 parent a446a34 commit 9600348
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,20 @@ utils.extend( proto, Unidragger.prototype );

// -------------------------- -------------------------- //

var isTouch = 'createTouch' in document;
var isTouchmoveScrollCanceled = false;

proto._createDrag = function() {
this.on( 'activate', this.bindDrag );
this.on( 'uiChange', this._uiChangeDrag );
this.on( 'childUIPointerDown', this._childUIPointerDownDrag );
this.on( 'deactivate', this.unbindDrag );
// HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
// #457, RubaXa/Sortable#973
if ( isTouch && !isTouchmoveScrollCanceled ) {
window.addEventListener( 'touchmove', function() {});
isTouchmoveScrollCanceled = true;
}
};

proto.bindDrag = function() {
Expand Down

0 comments on commit 9600348

Please sign in to comment.