MaxLeiter / sortablejs-vue3

A thin wrapper around Sortable.js for Vue 3
https://sortablejs-vue3.maxleiter.com
MIT License
378 stars 19 forks source link

How to edit the source item when cloning to another list #107

Open ralfcarneborn opened 6 months ago

ralfcarneborn commented 6 months ago

Hi i have this codesandbox: https://codesandbox.io/p/devbox/sortablejs-clone-forked-yqpqlk

When i drag an item from the source to the target, and then want to edit the source item, it always just updates the cloned item.

This is a simplified example, in my real app i am dragging an item from between two lists like this but on drop i remove the cloned item and manually add another type of component (dragging a text/image component, on drop it turns into a video).

After dropping I simply want to be able to update the original dragged item via the databinding, but any change only affects the cloned item (that is now removed).

How do i solve this?

pvpmartins commented 5 months ago

Man, I am currently looking to create a "deep copy" of the element when cloning... its been really tough to do it, But i will let you know if I made any progress.