Add workaround for touch events (and remove other workaround that didn't work)
Leaflet doesn't handle touchcancel events in L.Draggable._onDown. Workaround is similar to 1cecbe7f44
This commit is contained in:
@ -611,3 +611,13 @@ if(goog && goog.style) {
|
||||
};
|
||||
}
|
||||
|
||||
// Fix Leaflet: handle touchcancel events in Draggable
|
||||
L.Draggable.prototype._onDownOrig = L.Draggable.prototype._onDown;
|
||||
L.Draggable.prototype._onDown = function(e) {
|
||||
L.Draggable.prototype._onDownOrig.apply(this, arguments);
|
||||
|
||||
if(e.type === "touchstart") {
|
||||
L.DomEvent.on(document, "touchcancel", this._onUp, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user