Shopify / draggable

The JavaScript Drag & Drop library your grandparents warned you about.
https://shopify.github.io/draggable
MIT License
17.93k stars 1.09k forks source link

Draggable caught errors while triggering 'drag:over' #527

Open maxence33 opened 2 years ago

maxence33 commented 2 years ago

NPM Beta 12 built with esbuild

I am using swapAnimation from Plugins and I have an error on the below :

const sortable = new Sortable(document.querySelector('#experience_list'), {
    draggable: 'turbo-frame', 
    swapAnimation: {
    duration: 200,
    easingFunction: 'ease-in-out'
  },
  plugins: [Plugins.SwapAnimation]
});

which is :

Draggable caught errors while triggering 'drag:over' Array [ DOMException ]​ 0: DOMException: Node.insertBefore: Child to insert before is not a child of this node​ length: 1​

: Array [] Basically the sortage works but there is no animation. With `
    ` and `
  • ` the animation work perfectly. I tried to use a class instead of `turbo-frame` tag and the error disappears yet the animation still doesn't work. Is there an easy fix or something I didn't do right.
zjffun commented 2 years ago

You can try Plugins.SortAnimation. It is more suitable for this scene.