Skip to content

Commit 1d40952

Browse files
authored andcommitted
Sortable: Fix parent offset detection
Fixes #15021 Closes gh-1749
1 parent fd30534 commit 1d40952

File tree

Image for: File tree

1 file changed

Image for: 1 file changed
+6
-2
lines changed

1 file changed

Image for: 1 file changed
+6
-2
lines changed

‎ui/widgets/sortable.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,22 @@ return $.widget( "ui.sortable", $.ui.mouse, {
224224
left: event.pageX - this.offset.left,
225225
top: event.pageY - this.offset.top
226226
},
227-
parent: this._getParentOffset(),
228227

229228
// This is a relative to absolute position minus the actual position calculation -
230229
// only used for relative positioned helper
231230
relative: this._getRelativeOffset()
232231
} );
233232

234-
// Only after we got the offset, we can change the helper's position to absolute
233+
// After we get the helper offset, but before we get the parent offset we can
234+
// change the helper's position to absolute
235235
// TODO: Still need to figure out a way to make relative sorting possible
236236
this.helper.css( "position", "absolute" );
237237
this.cssPosition = this.helper.css( "position" );
238238

239+
$.extend( this.offset, {
240+
parent: this._getParentOffset()
241+
} );
242+
239243
//Generate the original position
240244
this.originalPosition = this._generatePosition( event );
241245
this.originalPageX = event.pageX;

0 commit comments

Image for: 0 commit comments
Comments
 (0)