Skip to content


Sortable: Fix parent offset detection
Browse files Browse the repository at this point in the history
Fixes #15021
Closes gh-1749
  • Loading branch information
typytype authored and scottgonzalez committed Oct 4, 2016
1 parent fd30534 commit 1d40952
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/widgets/sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,22 @@ return $.widget( "ui.sortable", $.ui.mouse, {
left: event.pageX - this.offset.left,
top: event.pageY -
parent: this._getParentOffset(),

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

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

$.extend( this.offset, {
parent: this._getParentOffset()
} );

//Generate the original position
this.originalPosition = this._generatePosition( event );
this.originalPageX = event.pageX;
Expand Down

0 comments on commit 1d40952

Please sign in to comment.