Skip to content

Commit 168a21d

Browse files
non4egscottgonzalez
authored andcommitted
Draggable: Apply ui-draggable-dragging class prior to calculating dimensions. Fixes #8349 - Draggable: Incorrect dimensions used if .ui-draggable-dragging changes dimensions
(cherry picked from commit a0c18ea)
1 parent f6019da commit 168a21d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ui/jquery.ui.draggable.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ $.widget("ui.draggable", $.ui.mouse, {
103103
//Create and append the visible helper
104104
this.helper = this._createHelper(event);
105105

106+
this.helper.addClass("ui-draggable-dragging");
107+
106108
//Cache the helper size
107109
this._cacheHelperProportions();
108110

@@ -163,7 +165,7 @@ $.widget("ui.draggable", $.ui.mouse, {
163165
if ($.ui.ddmanager && !o.dropBehaviour)
164166
$.ui.ddmanager.prepareOffsets(this, event);
165167

166-
this.helper.addClass("ui-draggable-dragging");
168+
167169
this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
168170

169171
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)

0 commit comments

Comments
 (0)