未验证 提交 c7249648 编写于 作者: R RomualdoGrillo 提交者: GitHub

Solves "inser Before" issue on nested lists

That solves an issue with nested sortables.
example of error https://codepen.io/romualdogrillo/pen/jOPoRJe
An error appears when all following conditions are met:
1)You have two nested sortable containers
2)option “pull:clone” i set at least on the parent container
3)You drag an item from the parent container into the nested container

The item is moved but not cloned and you get the error: 
“Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted”
上级 c36f49b7
......@@ -1692,7 +1692,7 @@ Sortable.prototype = /** @lends Sortable.prototype */ {
if (Sortable.eventCanceled) return;
// show clone at dragEl or original position
if (rootEl.contains(dragEl) && !this.options.group.revertClone) {
if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
rootEl.insertBefore(cloneEl, dragEl);
} else if (nextEl) {
rootEl.insertBefore(cloneEl, nextEl);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册