Skip to content

Commit cd5a4fa

Browse files
committed
sortable: only remove placeholder if necessary
1 parent 9fad37d commit cd5a4fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/sortable.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,8 @@ return $.widget("ui.sortable", $.ui.mouse, {
12671267
}
12681268

12691269
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
1270-
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
1270+
var parentNode = this.placeholder[0].parentNode;
1271+
if(parentNode) parentNode.removeChild(this.placeholder[0]);
12711272

12721273
if(this.helper[0] !== this.currentItem[0]) {
12731274
this.helper.remove();

0 commit comments

Comments
 (0)