[bug] `Sortable.sort()` with non-draggable items doesn't work properly
Describe the bug
Whenever sort() called on a sortable element which has one or more non-draggable items, it will sort them weirdly.
To Reproduce Steps to reproduce the behavior:
- Go to this JS Bin.
- Try to move an item without removing any item first, it sorts the items properly.
- Remove an item or more, then move an item, it sorts the existing items unexpectedly.
Expected behavior
sort() should sort the existing items like how it sort items on a sortable element with no non-draggable items.
Information
sortablejs = 1.15.0
Additional context None.
Reproduction codesandbox: -
I came to this issue due to a similar issue, but I was also dealing with a Svelte.
To fix my problem, I set forceFallback: true which counters the default HTML5 DnD behavior (which sets draggable=false. Because of Svelte's behavior, I had to use an afterUpdate() to set all the items in my list back to draggable=true
I'm thinking we're dealing with the same root cause.