Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion knockout-sortable.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@
// drop an item above the 3rd visible item, but the 2nd visible item
// has an actual index of 5.
if (e.item.previousElementSibling) {
newIndex = to().indexOf(ko.dataFor(e.item.previousElementSibling)) + 1;
newIndex = to().indexOf(ko.dataFor(e.item.previousElementSibling));
newIndex += (newIndex > originalIndex ? 0 : 1);
}

// Remove sortables "unbound" element
Expand Down