SortableJS / ngx-sortablejs

Angular 2+ binding to SortableJS. Previously known as angular-sortablejs
https://sortablejs.github.io/ngx-sortablejs/
MIT License
466 stars 160 forks source link

Incorrect order after adding an element in array #254

Open Pacofication opened 2 years ago

Pacofication commented 2 years ago

I'm having an issue with adding an element to an array after reordering elements. The element seems to be added in semi-random place in the UI, but in the correct position within the array.

I have a small demo with a similar use case : https://stackblitz.com/edit/angular-ivy-jvice4 To reproduce the problem

The order displayed will be 1,4,2,3 instead of 1,2,3,4 Clicking the the test button will display the array in the console, which is in the proper order.

Am I using the library wrong? Or is the issue with the library?

Thank you.

adgasi commented 2 years ago

@Pacofication It works properly with the demo you've provided. The order display is 1,2,3,4

Pacofication commented 2 years ago

@adgasi I made a gif showing the bug using the demo The order in the UI is 1,4,2,3 when adding an element after reordering

ngx-sortablejs bug

equilerex commented 2 years ago

duplicate of this most likely: https://github.com/SortableJS/ngx-sortablejs/issues/189