diff --git a/src/dom/Draggable.js b/src/dom/Draggable.js index 3e3146ca..743e1e6f 100644 --- a/src/dom/Draggable.js +++ b/src/dom/Draggable.js @@ -99,6 +99,10 @@ L.Draggable = L.Class.extend({ L.DomEvent .on(document, L.Draggable.MOVE[e.type], this._onMove, this) .on(document, L.Draggable.END[e.type], this._onUp, this); + + if (e.type === 'mousedown') { + L.DomEvent.on(document, 'mouseout', this._onUp, this); + } }, _onMove: function (e) { @@ -169,6 +173,8 @@ L.Draggable = L.Class.extend({ .off(document, L.Draggable.END[i], this._onUp); } + L.DomEvent.off(document, 'mouseout', this._onUp); + if (this._moved) { // ensure drag is not fired after dragend L.Util.cancelAnimFrame(this._animRequest);