radix-vue
radix-vue copied to clipboard
feat(Combobox): narrow modelValue as readonly array type
When a readonly array is passed as modelValue, it will error. This change will arrow a readonly array as modelValue. Internally Combobox modelValue is immutable.
Type 'readonly Option<T>[]' is not assignable to type 'Option<T> | Option<T>[] | undefined'.ts-plugin(2322)
@iamandrewluca what's the reason you are passing readonly to modelValue?
I try to keep my code as immutable and static as possible. I was looking through Combobox internals, and all the code is not doing any mutations to the state itself.
We try to keep the types as close to the v-model's types from Vue, so this addition might not be inline with the idea
I see 🤔 in this case, I will close the PR. Sorry for the inconvenience, and thanks for your attention.