Vue.Draggable icon indicating copy to clipboard operation
Vue.Draggable copied to clipboard

On-going drag is broken when another Draggable is removed from the DOM

Open alexisvapillon opened this issue 3 years ago • 1 comments

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: @end has 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).

alexisvapillon avatar Jan 07 '22 12:01 alexisvapillon

I can confirm this is happening. My workaround was using v-show instead of v-if to keep draggable in the DOM.

aldinezi avatar Mar 22 '22 18:03 aldinezi