Skip to content

Commit e68bee9

Browse files
committed
Mouse: Don't try to unbind delegated event handlers if they don't exist. Fixes #8416 - Draggable breaks during drag if any other draggable is removed or destroyed.
1 parent 7e1cb95 commit e68bee9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ui/jquery.ui.mouse.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ $.widget("ui.mouse", {
4747
// other instances of mouse
4848
_mouseDestroy: function() {
4949
this.element.unbind('.'+this.widgetName);
50-
$(document)
51-
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
52-
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
50+
if ( this._mouseMoveDelegate ) {
51+
$(document)
52+
.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
53+
.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
54+
}
5355
},
5456

5557
_mouseDown: function(event) {

0 commit comments

Comments
 (0)