Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

Selection broken in core-selection when the selected list is updated with same elements but different order #192

Open
fedy2 opened this issue Feb 13, 2015 · 3 comments

Comments

@fedy2
Copy link

fedy2 commented Feb 13, 2015

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.

@fedy2
Copy link
Author

fedy2 commented Feb 13, 2015

Using JsArray for selected list avoid the issue.

@jakemac53
Copy link
Contributor

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.

@jakemac53
Copy link
Contributor

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.

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

No branches or pull requests

2 participants