Open francoislehoux-okta opened 2 years ago
I'm open to exploring this, I see why you'd want this functionality. I'd probably go with the refresh
method route you mentioned.
How do you propose handling cases where a selected choice is no longer in the options of the underlying element?
Is your feature request related to a problem? Please describe. There is currently no clear way to have
choices
track the options from the underlying select element. We can use.setChoices
but we have to manually parse every. Most of this logic already exist within the constructor/init methods.Say, you are using choicesjs within react, when the children changes dynamically, you want an easy way to have those reflected in the rendered component.
It seems this has been asked often but was never considered or OKd (issue getting automatically closed after X days).
Describe the solution you'd like Could be:
Choices
refresh
method which would update choices (groups and options) based on the underlying elementDescribe alternatives you've considered This "works" but feels out of place when outside of the library itself.