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

[bug] Source element ID removed when cloned #2236

Open mwillema opened 1 year ago

mwillema commented 1 year ago

Describe the bug

When draggable elements have an id, this one is removed when one of those elements is cloned.

To Reproduce

  1. Go to https://jsbin.com/ruxecon/1/edit?html,js,output
  2. Drag an item from the first list, eg "foo" to the second list
  3. Inspect the HTML and observe that the dragged item from the first list, eg "foo", doesn't have its ID, ie "A1" anymore.

Expected behavior

The IDs of the elements having been dragged should still be present.

It makes sense that the IDs are removed on the cloned elements, ie the new ones, but not on the original elements.

Information

sortablejs = "^1.15.0