diff options
author | Mike Sherov <mike.sherov@gmail.com> | 2014-11-08 20:23:08 -0500 |
---|---|---|
committer | Mike Sherov <mike.sherov@gmail.com> | 2014-11-08 20:27:05 -0500 |
commit | d8077dc562bfca60906a160e20186608a10b7a87 (patch) | |
tree | 45ee2647264cbb06d6ca7a1947633b7932577072 /ui | |
parent | 4e860dca95e3ae35f871ae22256eaa1d18a56fb9 (diff) | |
download | jquery-ui-d8077dc562bfca60906a160e20186608a10b7a87.tar.gz jquery-ui-d8077dc562bfca60906a160e20186608a10b7a87.zip |
Draggable: Ensure parent is correct after dragging through sortable
Fixes #10669
Diffstat (limited to 'ui')
-rw-r--r-- | ui/draggable.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ui/draggable.js b/ui/draggable.js index b59955add..5be628dc8 100644 --- a/ui/draggable.js +++ b/ui/draggable.js @@ -800,6 +800,9 @@ $.ui.plugin.add( "draggable", "connectToSortable", { if ( !sortable.isOver ) { sortable.isOver = 1; + // Store draggable's parent in case we need to reappend to it later. + draggable._parent = ui.helper.parent(); + sortable.currentItem = ui.helper .appendTo( sortable.element ) .data( "ui-sortable-item", true ); @@ -876,8 +879,9 @@ $.ui.plugin.add( "draggable", "connectToSortable", { sortable.placeholder.remove(); } - // Recalculate the draggable's offset considering the sortable - // may have modified them in unexpected ways (#8809) + // Restore and recalculate the draggable's offset considering the sortable + // may have modified them in unexpected ways. (#8809, #10669) + ui.helper.appendTo( draggable._parent ); draggable._refreshOffsets( event ); ui.position = draggable._generatePosition( event, true ); |