demo · v146
Dropeffect handoff trace
A drag source, three drop targets with different intents (move / copy / link), and a live log that captures dataTransfer.dropEffect at every step of the dance: the last dragover on each target, the dragleave, the final drop. Before 146 the value reset to "none" by the time drop fired; from 146 the value the page set in dragover survives.
Drag the source onto each target. Watch the last dragover log entry — that's the page's intent. Then watch what drop reports. Toggle the simulator to "pre-146" to see the legacy behaviour.
drag this →
move target
dropEffect = "move"
dropEffect = "move"
copy target
dropEffect = "copy"
dropEffect = "copy"
link target
dropEffect = "link"
dropEffect = "link"
no-drop target
(leaves dropEffect alone)
(leaves dropEffect alone)
event feed
// 146 contract: dataTransfer.dropEffect set in dragover survives the drop event.
target.addEventListener("dragover", (e) => {
e.preventDefault();
e.dataTransfer.dropEffect = "copy"; // pre-146 was reset to "none" before "drop"
});
target.addEventListener("drop", (e) => {
console.log(e.dataTransfer.dropEffect); // 146 → "copy". pre-146 → "none".
});