Closed Lxstr closed 4 months ago
Fixed it. Will be available in the next release. Expected behaviour:
MultiSelect
After changing the options, only the values that are also present in the new options are kept, rest are removed from value
.
Select
After changing the options, if the currently selected value is not part of the new options, then value
is set to null
.
When a multi-select has one or more selections made but then you change the options available (data prop) to not include those selected, the dropdown is blank. This is suggesting to the user that there is no longer a selection but the values are actually still there in the properties and affecting the outcome.
I think it would be best to either continue showing the values or remove only the values that no longer exist in the new options.
Initially, I was leaning to prefer the second option but I realised there may be situations where the options may be temporarily absent due to a mis-load of options or the user may be playing with different option sets and be annoyed if their selections keep disappearing. Further to this the user may have created their own option using the creatable prop. So I'm thinking it's best to display the selected values even if they are no longer available options and let the user remove them explicitly.
Side note: Initially I thought this issue was related to my use of persistence, but when I did the MRE below, there's no persistence.