Skip to content

Commit 8e899da

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.
(cherry picked from commit 32f356b)
1 parent 6a665a1 commit 8e899da

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
@@ -155,11 +155,6 @@ $.widget("ui.sortable", $.ui.mouse, {
155155
left: this.offset.left - this.margins.left
156156
};
157157

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

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

0 commit comments

Comments
 (0)