Vue.Draggable
Vue.Draggable copied to clipboard
On-going drag is broken when another Draggable is removed from the DOM
Jsfiddle links
- Bug with
Vue.Draggable: https://jsfiddle.net/alexisvapillon/tod6ghym/ - No bug with
SortableJS: https://jsfiddle.net/alexisvapillon/2w93Lxdg/
Step by step scenario
- On a page with 2 Draggables A and B
- Start dragging an item from A
- Keep dragging
- During the drag, B is removed from the DOM (for any reason)
- BUG: A doesn't react anymore to your on-going moves (it should still work as normal)
- Drop the item
- BUG:
@endhas not been called (it should have been at previous step) - But A is still working now.
Actual Solution
Sorry no fix to propose, but I verified that the bug doesn't occur with SortableJS alone (See Jsfiddle links).
I can confirm this is happening. My workaround was using v-show instead of v-if to keep draggable in the DOM.