SortableJS / Sortable

Reorderable drag-and-drop lists for modern browsers and touch devices. No jQuery or framework required.
https://sortablejs.github.io/Sortable/
MIT License
29.78k stars 3.7k forks source link

onClone event fires even if the element is moved, not cloned #2211

Open PratikDev opened 2 years ago

PratikDev commented 2 years ago

As mentioned on title, the onClone event fires even if the element is just moved, not cloned. Besides that

  1. onClone: function (ev) { console.log(ev.clone) } above code returns a DOM element that you can't even find on the document when you click the result on the console. but it's supposed to return nothing (when the pull is not set to "clone")

  2. onClone: function (ev) { console.log(ev.clone) } if we check it with pull: 'clone', it returns the original element. but it's supposed to return the cloned element

  3. console.log(ev.item ) should return the whole original element (with pull: 'clone'). but it's returning only the actual element without the nested childs

here's a preview of the issue https://codesandbox.io/s/hopeful-thompson-9t0q18?file=/src/index.js:1147-1178

trasherdk commented 2 years ago

Hmmm.. ?

image

PratikDev commented 2 years ago

seems issue_4 is solved (or maybe it was never there. the prob was on my browser). but what about the rest three?