You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by kerunix November 17, 2022
Hello there and thank you so much for the great job you're doing at Tailwind Labs, you guys are great !
I'm working on a select menu in a Vue 3 app using Listbox as my base component. My select menu needs to accept null as a possible value. Technically it works at runtime with no problem but Volar is not happy about the type declarations of Listbox.
<!-- inputValue is nullable -->
<Listbox
:model-value="inputValue" <!-- Type 'null' is not assignable to type 'string | number | boolean | Record<string, any> | undefined'. -->
>
<!-- code -->
</Listbox>
The current type declarations are:
modelValue: { type: [Object, String, Number, Boolean], default: undefined } // For the Listbox component
value: { type: [Object, String, Number, Boolean] } // For the ListboxOption component
Do you see any problem with adding null as a possible type ?
I'm willing to work on a PR for this if needed although I'm not sure how that would go for the React package since I don't know anything about React.
The text was updated successfully, but these errors were encountered:
Hey! Thank you for your feature suggestion! Much appreciated! pray
This should be improved by #2064, and will be available in the next release.
You can already try it using npm install @headlessui/vue@insiders.
I tried it using the insiders version and the issue is only partially fixed since the changes to the typings are working with the model-value prop on the Listbox but they don't seem to apply to the value prop on the ListboxOption component.
Discussed in #2026
Originally posted by kerunix November 17, 2022
Hello there and thank you so much for the great job you're doing at Tailwind Labs, you guys are great !
I'm working on a select menu in a Vue 3 app using
Listbox
as my base component. My select menu needs to acceptnull
as a possible value. Technically it works at runtime with no problem but Volar is not happy about the type declarations of Listbox.<!-- inputValue is nullable --> <Listbox :model-value="inputValue" <!-- Type 'null' is not assignable to type 'string | number | boolean | Record<string, any> | undefined'. --> > <!-- code --> </Listbox>
The current type declarations are:
Do you see any problem with adding
null
as a possible type ?I'm willing to work on a PR for this if needed although I'm not sure how that would go for the React package since I don't know anything about React.
The text was updated successfully, but these errors were encountered: