Selection broken in core-selection when the selected list is updated with same elements but different order
I'm updating the selected list passed to core-selector with the same elements but in reverse order, this cause some elements change his state to un-selected.
Using JsArray for selected list avoid the issue.
Yes, that is unfortunately expected behavior. The only supported way currently of selecting and unselecting items are the selectItem and setItemSelected methods. I didn't realize that it could work to simply modify the list if its a JsArray, but that makes sense. The actual reason this doesn't work is because the js proxies for the items change each time we call jsify, but that is a no-op if its already a JsArray.
This has come up a few times so I think I will leave this bug open as a reference for people.
I think there is a bug somewhere to use the same instance of the js proxy for a dart object if you call jsify on it multiple times, so once that is fixed then this will no longer be an issue.