Understand the Drag Lifecycle
masterThe drag lifecycle involves several stages, from initial click to final drop. Understanding this sequence is crucial for implementing custom logic via callbacks and events.
Sequence Overview:
- Down: Initial click.
- Move: Initial drag starts.
get-child-payload()is called to retrieve the payload.should-accept-drop()is called for all containers.drag-startis fired for all containers.drag-enteroccurs as the item enters a container.
- Drag Over: Moving over containers.
drag-leave(as it leaves a container).drag-enter(as it enters a container).
- Up: Finish drag.
should-animate-drop()is called for the target container.drag-endis fired for all containers.dropis fired only for droppable containers.
Data Formats:
dragResult:{ payload, isSource, willAcceptDrop }dropResult:{ addedIndex, removedIndex, payload, droppedElement }