Added an internal drag zone id/type to DraggableList and its items to restrict items to their respective lists
This commit is contained in:
parent
0eeabd7883
commit
1aebdea512
|
@ -13,6 +13,8 @@
|
||||||
export let draggable = true
|
export let draggable = true
|
||||||
export let focus
|
export let focus
|
||||||
|
|
||||||
|
let zoneType = generate()
|
||||||
|
|
||||||
let store = writable({
|
let store = writable({
|
||||||
selected: null,
|
selected: null,
|
||||||
actions: {
|
actions: {
|
||||||
|
@ -46,6 +48,7 @@
|
||||||
return {
|
return {
|
||||||
id: listItemKey ? item[listItemKey] : generate(),
|
id: listItemKey ? item[listItemKey] : generate(),
|
||||||
item,
|
item,
|
||||||
|
type: zoneType,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.filter(item => item.id)
|
.filter(item => item.id)
|
||||||
|
@ -83,6 +86,8 @@
|
||||||
items: draggableItems,
|
items: draggableItems,
|
||||||
dropTargetStyle: { outline: "none" },
|
dropTargetStyle: { outline: "none" },
|
||||||
dragDisabled: !draggable || inactive,
|
dragDisabled: !draggable || inactive,
|
||||||
|
type: zoneType,
|
||||||
|
dropFromOthersDisabled: true,
|
||||||
}}
|
}}
|
||||||
on:finalize={handleFinalize}
|
on:finalize={handleFinalize}
|
||||||
on:consider={updateRowOrder}
|
on:consider={updateRowOrder}
|
||||||
|
|
Loading…
Reference in New Issue