tinloof / drag-and-drop-article

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

reordering logic: dragOver vs dragEnd

drzraf opened this issue · comments

It's not clear why reordering happens during dragOver instead of dragEnd.

I know the solution for this, taking this up.

Fixed in this PR
#2

Thanks @drzraf for taking the time to write an issue and @sukrut-gs for pushing a potential fix.
The reason for the reordering happening in onDragOver is because we want to show a preview how the list will look like whenever we move the dragged element over another.

If you look again at the gif showing the final result, you'd see that the list changes whenever you drag an element over another before even dropping it.

Does that make sense?