Skip to content

Commit 32f356b

Browse files
martinf55scottgonzalez
authored andcommitted
Sortable: Moved change of helper position css. Fixed #5321 – Helper in a bottom-positioned Sortable is positioned wrong on drag start.
1 parent a0c734b commit 32f356b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ui/jquery.ui.sortable.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,6 @@ $.widget("ui.sortable", $.ui.mouse, {
154154
left: this.offset.left - this.margins.left
155155
};
156156

157-
// Only after we got the offset, we can change the helper's position to absolute
158-
// TODO: Still need to figure out a way to make relative sorting possible
159-
this.helper.css("position", "absolute");
160-
this.cssPosition = this.helper.css("position");
161-
162157
$.extend(this.offset, {
163158
click: { //Where the click happened, relative to the element
164159
left: event.pageX - this.offset.left,
@@ -168,6 +163,11 @@ $.widget("ui.sortable", $.ui.mouse, {
168163
relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
169164
});
170165

166+
// Only after we got the offset, we can change the helper's position to absolute
167+
// TODO: Still need to figure out a way to make relative sorting possible
168+
this.helper.css("position", "absolute");
169+
this.cssPosition = this.helper.css("position");
170+
171171
//Generate the original position
172172
this.originalPosition = this._generatePosition(event);
173173
this.originalPageX = event.pageX;

0 commit comments

Comments
 (0)