Ensure null IDs are pruned from draggable list to avoid crashing
This commit is contained in:
parent
c1f344347d
commit
471a5838a3
|
@ -33,17 +33,19 @@
|
||||||
let anchors = {}
|
let anchors = {}
|
||||||
let draggableItems = []
|
let draggableItems = []
|
||||||
|
|
||||||
const buildDragable = items => {
|
const buildDraggable = items => {
|
||||||
return items.map(item => {
|
return items
|
||||||
return {
|
.map(item => {
|
||||||
id: listItemKey ? item[listItemKey] : generate(),
|
return {
|
||||||
item,
|
id: listItemKey ? item[listItemKey] : generate(),
|
||||||
}
|
item,
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
.filter(item => item.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
$: if (items) {
|
$: if (items) {
|
||||||
draggableItems = buildDragable(items)
|
draggableItems = buildDraggable(items)
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateRowOrder = e => {
|
const updateRowOrder = e => {
|
||||||
|
|
Loading…
Reference in New Issue