dnd-kit
dnd-kit copied to clipboard
onDragOver gets triggered with onDragStart
onDragOver gets triggered with onDragStart
version:
"@dnd-kit/core": "^6.0.5",
"@dnd-kit/sortable": "^7.0.1",
"@dnd-kit/utilities": "^3.2.0",
Can you share a re-creatable example?
This is most likely correct, because you are over your active item. If you check the over.id you should see that its equal to the active.id.
The problem with this is that the screen reader will interrupt itself and never read the text for onDragStart. We could have onDragOver compare the two, but it can't differentiate between having just picked up the object vs dragging it back over itself.
Currently working around this by setting a piece of state in onDragStart and clearing it in onDragOver:
onDragStart({ active }) {
setIsFirstTouch(true);
return `Picked up draggable item ${active.id}.`;
},
onDragOver({ active, over }) {
if (isFirstTouch) {
setIsFirstTouch(false);
return;
}
if (over) {
...