Alfred-Skyblue / vue-draggable-plus

Universal Drag-and-Drop Component Supporting both Vue 3 and Vue 2
https://vue-draggable-plus.pages.dev/en/
MIT License
2.74k stars 106 forks source link

use draggable index for re-ordering elements in the model #44

Closed gsmith-daed closed 10 months ago

gsmith-daed commented 10 months ago

When using the sortable.js "draggable" option to exclude HTML nodes, the model list is re-ordered incorrectly unless the oldDraggableIndex and newDraggableIndex fields of the event are used to update the store.

oldIndex and oldDraggableIndex match when the "draggable" option is not used, so I believe this fix works for both cases.