Closed jamesst20 closed 6 months ago
Workaround is to use the proper index:
evt.oldDraggableIndex; // element's old index within old parent, only counting draggable elements
evt.newDraggableIndex; // element's new index within new parent, only counting draggable elements
Versions
SortableJS 1.15.2
Reproduction
CodeSandbox
Why this is happening
It seems SortableJS internally doesn't care for the draggable class when it counts children so the
<thead>
count for one element always while not being draggable at all.An ugly workaround is to offset by -1 in my function but this is most likely a bug.