mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Sortable: Fix a bug of removing an item while iterating an array. Fixes #8571 - Out of range problem in when dragging a nested sortable.
This commit is contained in:
parent
a3f1a34d3b
commit
77a4aaf47a
11
ui/jquery.ui.sortable.js
vendored
11
ui/jquery.ui.sortable.js
vendored
@ -562,14 +562,13 @@ $.widget("ui.sortable", $.ui.mouse, {
|
||||
|
||||
var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
|
||||
|
||||
for (var i=0; i < this.items.length; i++) {
|
||||
|
||||
this.items = $.grep(this.items, function (item) {
|
||||
for (var j=0; j < list.length; j++) {
|
||||
if(list[j] == this.items[i].item[0])
|
||||
this.items.splice(i,1);
|
||||
};
|
||||
|
||||
if(list[j] == item.item[0])
|
||||
return false;
|
||||
};
|
||||
return true;
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user