Skip to content

Commit a0c18ea

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
1 parent db9a015 commit a0c18ea

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
@@ -102,6 +102,8 @@ $.widget("ui.draggable", $.ui.mouse, {
102102
//Create and append the visible helper
103103
this.helper = this._createHelper(event);
104104

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

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

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

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

0 commit comments

Comments
 (0)