Sortable
Sortable copied to clipboard
Bug: sort method doesn't work if there are other children in the sortable parent
Problem:
If you create a sortable on a container, and use the draggable selector to identify the sortable elements, but there are other non-sortable sibling elements in that container, the sort method fails. An example would be if a header was the first child of the sortable container.
The problem is this line. This is getting the child at the index of the loop, but it's considering all child elements. It needs to first sort out those that don't match the draggable selector. https://github.com/SortableJS/Sortable/blob/master/src/Sortable.js#L1571
JSBin/JSFiddle demonstrating the problem:
https://jsfiddle.net/pr3tori4n/k17dhqo8/