mfuu / vue3-virtual-drag-list

A virtual scrolling list component that can be sorted by dragging, for vue3
https://mfuu.github.io/vue3-virtual-drag-list/
MIT License
38 stars 11 forks source link

Drop method triggering issue #13

Open max-min-max opened 10 months ago

max-min-max commented 10 months ago

drop method; Why is it executed twice when dragging is completed

mfuu commented 10 months ago

If the drop list is different from the start, both lists are triggered once.

pu-raihan commented 3 months ago

drop method; Why is it executed twice when dragging is completed

You can actually check the event.oldIndex and event.newIndex. the list from which the item is dragged will be having event.newIndex = -1, and list which the item is dragged to will have event.oldIndex =-1