rniemeyer / knockout-sortable

A Knockout.js binding to connect observableArrays with jQuery UI sortable functionality
MIT License
547 stars 128 forks source link

Sorting with destroyed items duplicate elements #153

Open Sbou opened 8 years ago

Sbou commented 8 years ago

Hi,

I found a bug when you destroy first element. In this case, the second element becomes the visible first element. If i move this element at last position it was duplicated.

I think is in updateIndexFromDestroyedItems function.

In case of index zero is not enter in for loop. If I change operator is ok.

for (var i = 0; i <= index; i++) {