Parameter in sortable:sorted event callback has the following data structure
@type { Object } e - Parameter in sortable:sorted event callback
@prop { Object } e.data
@prop { Object } e.data.moves
@prop { Object } e.data.moves.oldIndex
@prop { Object } e.data.moves.newIndex
The oldIndex and newIndex are inconsistent depending on the source element's original order in the list.
Calculation of the indexes should consider the cloned source element, because before dragging, there are, say, 4 elements in the list. On dragging, a new cloned element is inserted into the list, so there will be 5 elements in the list.
Thanks for reporting, yes this has been broken since we fixed the touch issues. This will be fixed for the next release. I'll let you know once the fix is in 馃憤
We want to have full test coverage for the first stable release, so this won't happen again
Fix will be out for the next beta release, here the commit: https://github.com/Shopify/draggable/commit/90e0b4c098c6410513efe845688fb896d19e0102
It will now ignore the originalSource and a mirror when computing the index
Most helpful comment
Thanks for reporting, yes this has been broken since we fixed the
touchissues. This will be fixed for the next release. I'll let you know once the fix is in 馃憤We want to have full test coverage for the first stable release, so this won't happen again