We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ba86ae0 + 630135c commit 5af4d5cCopy full SHA for 5af4d5c
knockout-sortable.js
@@ -140,7 +140,11 @@
140
// drop an item above the 3rd visible item, but the 2nd visible item
141
// has an actual index of 5.
142
if (e.item.previousElementSibling) {
143
- newIndex = to().indexOf(ko.dataFor(e.item.previousElementSibling)) + 1;
+ newIndex = to().indexOf(ko.dataFor(e.item.previousElementSibling));
144
+
145
+ if (newIndex < originalIndex) {
146
+ newIndex++;
147
+ }
148
}
149
150
// Remove sortables "unbound" element
0 commit comments