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 draggableItems = []
|
||||
|
||||
const buildDragable = items => {
|
||||
return items.map(item => {
|
||||
return {
|
||||
id: listItemKey ? item[listItemKey] : generate(),
|
||||
item,
|
||||
}
|
||||
})
|
||||
const buildDraggable = items => {
|
||||
return items
|
||||
.map(item => {
|
||||
return {
|
||||
id: listItemKey ? item[listItemKey] : generate(),
|
||||
item,
|
||||
}
|
||||
})
|
||||
.filter(item => item.id)
|
||||
}
|
||||
|
||||
$: if (items) {
|
||||
draggableItems = buildDragable(items)
|
||||
draggableItems = buildDraggable(items)
|
||||
}
|
||||
|
||||
const updateRowOrder = e => {
|
||||
|
|
Loading…
Reference in New Issue