Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect order after adding an element in array #254

Open
Pacofication opened this issue Jan 11, 2022 · 3 comments
Open

Incorrect order after adding an element in array #254

Pacofication opened this issue Jan 11, 2022 · 3 comments

Comments

@Pacofication
Copy link

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.

@adgasi
Copy link

adgasi commented Jan 28, 2022

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

@Pacofication
Copy link
Author

@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
Copy link

duplicate of this most likely: #189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants