rniemeyer / knockout-sortable

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

Fixes issue where source array is corrupted with duplicates when destroyed items exist before sorting. #197

Closed chadedrupt closed 5 years ago

chadedrupt commented 5 years ago

Steps to reproduce issue:

This is happens because currently updateIndexFromDestroyedItems is passed in an index of 1 and it only searches the source array for destroyed items up to i < 1 however in the source array our destroyed item is at index 1, therefore the destroyed item's influence on the required indexes is ignored.

rniemeyer commented 5 years ago

Thanks @chadedrupt! - merged and published as 1.1.1.