Skip to content

Commit ed65ce7

Browse files
kborchersscottgonzalez
authored andcommitted
Sortable: Changed to check the parent's length so that the dom position of the removed element is not updated. Fixed #4088 - Unable to remove() ui.draggable (sortable item) immediately after the drop callback.
(cherry picked from commit 8e8a7b0)
1 parent 9c0cd47 commit ed65ce7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ui/jquery.ui.sortable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ $.widget("ui.sortable", $.ui.mouse, {
984984

985985
// We first have to update the dom position of the actual currentItem
986986
// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
987-
if(!this._noFinalSort && this.currentItem[0].parentNode) this.placeholder.before(this.currentItem);
987+
if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
988988
this._noFinalSort = null;
989989

990990
if(this.helper[0] == this.currentItem[0]) {

0 commit comments

Comments
 (0)