Skip to content

Commit

Permalink
Sortable: Changed to check the parent's length so that the dom positi…
Browse files Browse the repository at this point in the history
…on 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)
  • Loading branch information
kborchers authored and scottgonzalez committed May 25, 2011
1 parent 9c0cd47 commit ed65ce7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui/jquery.ui.sortable.js
Expand Up @@ -984,7 +984,7 @@ $.widget("ui.sortable", $.ui.mouse, {

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

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

0 comments on commit ed65ce7

Please sign in to comment.