Join GitHub today
Fix _SelectionModel and _MultipleSelectionModel to sync using indices #1262
@maartenbreddels, can you give this a try and see how it works?
Possibly, though I don't like having two possibly conflicting sources of truth in the protocol, and it becomes confusing on who sets it (frontend or backend? Both I think have a valid usecase).
Two design decisions:
(a) in this implementation, the default selection is no selection (except for the selection slider, which must have something selected
(b) We always coerce the options list to a
I went ahead and changed this to always select the first item (if there is a first item) on initialization or when changing the options. That seems to work better with interact, for example, where you just want some value by default.
However, I left the multiple select to still unselect all items when changing the options or setting it initially. Thoughts?
referenced this pull request
Apr 7, 2017
(This is a change - before, if the options changed in a multiple select, it would try to match up the previous selected labels to attempt to select the same items after the change. I think that is very error-prone.)