Skip to content

Commit 7745d61

Browse files
committed
Draggable: No longer using disableSelection in favor of preventDefault
1 parent 7ef6df9 commit 7745d61

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ui/jquery.ui.draggable.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ $.widget( "ui.draggable", {
5252
this.element.css( "position", "relative" );
5353
}
5454

55-
// Prevent browser from hijacking drag
56-
this.element.disableSelection();
57-
5855
// Using proxy to avoid anon functions using self to pass "this" along
5956
this.element.bind( "mousedown." + this.widgetName, $.proxy( this._mouseDown, this ) );
6057

@@ -111,6 +108,9 @@ $.widget( "ui.draggable", {
111108
},
112109

113110
_mouseDown: function( event ) {
111+
112+
// Stop browser from highlighting, among other things
113+
event.preventDefault();
114114

115115
// The actual dragging element, should always be a jQuery object
116116
this.dragEl = this.element;
@@ -147,8 +147,7 @@ $.widget( "ui.draggable", {
147147
this.dragEl
148148
.css({
149149
position: "absolute"
150-
})
151-
.disableSelection();
150+
});
152151

153152
$( "body" ).append( this.dragEl );
154153

0 commit comments

Comments
 (0)