diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-11-15 18:39:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-15 18:39:25 +0100 |
commit | b52ee4012d13e2f531a39fe0a53366e119dd1501 (patch) | |
tree | d3a952048d41e0d900265f2ec7fe3763fef989f9 /ui | |
parent | efe3b225179f8f2f3f2c05484f7757f90bc5a27b (diff) | |
download | jquery-ui-b52ee4012d13e2f531a39fe0a53366e119dd1501.tar.gz jquery-ui-b52ee4012d13e2f531a39fe0a53366e119dd1501.zip |
Sortable: Fix positioning when moving a Draggable item into a Sortable
PR gh-1793 removed setting `this.offset.parent` in the Draggable
`refreshPositions` method which broke position calculations when moving
a Draggable item into a connected Sortable. restore that assignment.
Ref gh-1793
Fixes gh-2001
Closes gh-2009
Diffstat (limited to 'ui')
-rw-r--r-- | ui/widgets/sortable.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/widgets/sortable.js b/ui/widgets/sortable.js index 37ce4b7bb..f5dc5ecce 100644 --- a/ui/widgets/sortable.js +++ b/ui/widgets/sortable.js @@ -885,6 +885,12 @@ return $.widget( "ui.sortable", $.ui.mouse, { this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : false; + // This has to be redone because due to the item being moved out/into the offsetParent, + // the offsetParent's position will change + if ( this.offsetParent && this.helper ) { + this.offset.parent = this._getParentOffset(); + } + this._refreshItemPositions( fast ); var i, p; |