When an HTML5 drag operation ends over another window, a Drop
event fires in the target window and a DragEnd
event fires on the dragged element in the source window.
For both copy and move, the drop target will perform a copy operation using the data carried by e.dataTransfer
, and for the move operation the item must be removed in the source window.
When the event fires in the source window, how should the DragEnd
handler determine whether the operation culminated in a drop or was aborted?
It is not enough to know whether a copy or cut operation is underway; a cut operation removes the item from the source only when it succeeds at the destination. It is, if you like, transactional.