ngx-sortablejs icon indicating copy to clipboard operation
ngx-sortablejs copied to clipboard

Incorrect order after adding an element in array

Open Pacofication opened this issue 4 years ago • 3 comments

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

  • Drag and Drop the second element over the third
  • Drag and Drop the third element over the second
  • Click the Add Elem button

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.

Pacofication avatar Jan 11 '22 20:01 Pacofication

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

adgasi avatar Jan 28 '22 07:01 adgasi

@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

Pacofication avatar Jan 28 '22 13:01 Pacofication

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

equilerex avatar Mar 29 '22 13:03 equilerex