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] Sortable swapping does not work when forceFallback is enabled and a handle or content is a custom element (web component) with a shadowRoot #2346

Closed driskull closed 8 months ago

driskull commented 9 months ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codepen.io/driskull/pen/OJqrzVL?editors=1010
  2. Try to drag a handle over another handle and notice it won't swap elements
  3. Drag a handle over a list element textContent and notice it does swap
  4. If there are other custom-elements inside the list-element in place of the text content elements won't swap either.
  5. See sample: https://codepen.io/driskull/pen/xxBmpra?editors=0110

Expected behavior

I would expect sort swapping to work when a handle or content within a list is a custom element.

Information

sortablejs = ^1.15.1 @types/sortablejs = ^1.15.1

Additional context I have a PR open to fix this but need verification that it is the best approach to fixing the issue.

Reproduction codesandbox: https://codepen.io/driskull/pen/OJqrzVL?editors=1010 and https://codepen.io/driskull/pen/xxBmpra?editors=0110

Pull Request Fix

https://github.com/SortableJS/Sortable/pull/2347

owen-m1 commented 8 months ago

Thank you, PR has been merged

driskull commented 8 months ago

Thank you @owen-m1 🍻

jcfranco commented 8 months ago

Thanks, @driskull and @owen-m1! When is the next SortableJS release planned?

driskull commented 5 months ago

@owen-m1 any chance we can get a new release with this fix?

owen-m1 commented 3 months ago

Thank you @driskull it has been released in 1.15.3