Added an internal drag zone id/type to DraggableList and its items to restrict items to their respective lists

This commit is contained in:
Dean 2024-01-04 17:20:47 +00:00
parent 0eeabd7883
commit 1aebdea512
1 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,8 @@
export let draggable = true
export let focus
let zoneType = generate()
let store = writable({
selected: null,
actions: {
@ -46,6 +48,7 @@
return {
id: listItemKey ? item[listItemKey] : generate(),
item,
type: zoneType,
}
})
.filter(item => item.id)
@ -83,6 +86,8 @@
items: draggableItems,
dropTargetStyle: { outline: "none" },
dragDisabled: !draggable || inactive,
type: zoneType,
dropFromOthersDisabled: true,
}}
on:finalize={handleFinalize}
on:consider={updateRowOrder}