]> source.dussan.org Git - jquery-ui.git/commitdiff
sortable: if current item was removed by user, it was reappended by the clearing...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 10 Feb 2009 10:07:25 +0000 (10:07 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Tue, 10 Feb 2009 10:07:25 +0000 (10:07 +0000)
ui/ui.sortable.js

index 56c613d044273767b15072a0458588acd7ba65de..e3a3f3d3d73ac03faa9ccc62d8db314900a1f629 100644 (file)
@@ -901,8 +901,9 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
                // everything else normalized again
                var delayedTriggers = [], self = this;
 
-               //We first have to update the dom position of the actual currentItem
-               if(!this._noFinalSort) this.placeholder.before(this.currentItem);
+               // 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);
                this._noFinalSort = null;
 
                if(this.helper[0] == this.currentItem[0]) {