You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With VirtualList, when adding new elements in the middle of the source list, 2 (or more) items can be selected at the same time, like if they were considered as the same item:
First click on button "Update", which creates the bug => items "20" and "50" are selected together.
Click on button "Update2" => items "20" and "50" are still selected together, even when separated by other items.
The text was updated successfully, but these errors were encountered:
dajoha
changed the title
VirtualList issue: multiple items are selected at the same time when inserting new elements
VirtualList: multiple items are selected at the same time when inserting new elements
Apr 28, 2024
This is because of the way you are using the virtual list. When using a stack or list, the items are checked for uniqueness using the key function. Because you have items that the same between the two lists, the stack isn't going to register that there has been a change on those items. You would instead need to use a different key that shows that the items are unique.
With
VirtualList
, when adding new elements in the middle of the source list, 2 (or more) items can be selected at the same time, like if they were considered as the same item:Can be reproduced with this code:
Then:
The text was updated successfully, but these errors were encountered: