Open jfrei opened 8 years ago
Actually, I'm finding that newIndex is always 0 at that point and so the fix isn't working for me, but I'm glad that someone is looking into it.
This seems to work for me, but isn't pretty:
140 if (e.item.previousElementSibling) {
141 newIndex = to().indexOf(ko.dataFor(e.item.previousElementSibling));
142 newIndex += (newIndex > originalIndex ? 0 : 1);
143 }
I've confirmed the code you've pasted above works and it looks better than what I've done :+1: Also, quick thanks for the plugin, saved me lots of time :)
Yes! Been having the same problem and this fixed it, thank you. Can this please be merged into the master?
Yes, please! Merge it. It solved my last problem with knockout-sortable.
Note: Has not been tested with dragging/dropping with more than one collection.