Drag handles
The dragHandleZone and dragHandle attachments.
The drag handles guide shows how the two work together.
dragHandleZone
Turns the element into a dnd zone whose items can only be dragged from their drag handles. Mark the handle inside
each item with {@attach dragHandle}. dragDisabled applies to this zone's handles only.
Credit for the idea and initial implementation goes to
function dragHandleZone<T extends object>(getOptions: () => Options<T>): Attachment<HTMLElement> It takes the same options as dndzone.
dragHandle
Marks a drag handle inside an item of a dragHandleZone. Use it as {@attach dragHandle}. The handle belongs to the
nearest handle zone around it, gets role="button", and starts a drag with the pointer or the keyboard drag
trigger. A handle outside of any handle zone does nothing.
const dragHandle: Attachment<HTMLElement>