-
Notifications
You must be signed in to change notification settings - Fork 26
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
Sort is corrupted when using a custom component in SortableItemTemplate #6
Comments
Hi @GerardFR I faced a similar issue. If you wrap your component in a div, does it work as expected?
|
Yes that fixes it, thank you! |
I wasted so much time trying to figure this out. For me it would sometimes work and sometimes not. I thought it was an issue related to the UI not updating even though the list was updated in the code. Adding a div wrapper seems to have fixed it! |
Hi @nabeelfarooqui98 yes, it seems to fix it, as you can see in my previous answer 😉 |
Thanks for this, something so simple that I had not tried yet. Completely eliminated the issue. |
… wrapping items in a div the-urlist/BlazorSortable#6
When using a custom component in
SortableItemTemplate
, the sorted output can be corrupted. Actually, it seems that sorting is right, but the display of the components doesn't happen in the correct order, and the visual result is wrong.I created a testing repository that illustrates the issue, with a simple component that displays a text, or another one that shows an image. Both have the same issue. See here.
The following code works fine:
But that one has the issue:
where
TextComponent
has the code from the previous section:Here is a capture showing the issue. The three blocks show the same list and the should always be synchronized, but the last one is wrong. I just moved 6 before 5. The issue only seems to happen if you start by moving an item to the left.
My feeling is that there is a synchronization issue, but I can't figure out where it comes from.
The text was updated successfully, but these errors were encountered: