Multiple lists
Lists that share a group exchange items. Drag a row from one column to the other:
Three details make this work:
- Both
<vdnd-sortable-list>elements are inside the samevdndGroup, and so is the shared item template. - Both lists bind
(drop). The event fires on the destination list only, so a list without a handler silently rejects items. moveItem()receives every list, keyed bydroppableId. It handles moves within a list as well as between lists. If a droppable ID is missing from the map, the drop is ignored and a warning is logged in dev mode.
A board with any number of columns
Keep one signal per column and build the map for moveItem() from your column list:
Draggable IDs must be unique across all columns, because drag state is shared across the whole app.
Controlling where items can go
A disabled droppable is skipped completely. The pointer passes through it to whatever is underneath, and the keyboard's left and right arrows skip it. See Drag behavior.
Releasing over nothing, or over a disabled list, emits no (drop). The item returns to where it started.
Accepting only some items
There is no predicate input that rejects some items. Returning early from (drop) keeps your data unchanged, but during the drag the target list still opens a slot for the item, so the user sees a drop that then does not happen.
Instead, disable the list while an item it does not accept is being dragged. DragStateService tells you which item that is, and a droppable whose disabled changes mid-drag is skipped from the next frame:
The pointer then passes over the list without a placeholder, and the keyboard's left and right arrows skip it. Style .vdnd-droppable-disabled to show that the list does not accept the item.