nullable prop on the Combobox component (#2660)
* move `nullable` handling to `onChange` of `Combobox.Input` itself We were specifically handling backspace/delete keys to verify if the `Combobox.Input` becomes empty then we can clear the value if we are in single value and in nullable mode. However, this doesn't capture other ways of clearing the `Combobox.Input`, for example when use `cmd+x` or `ctrl+y` in the input. Moving the logic, gives us some of these cases for free. * ensure pressing `escape` also clears the input in nullable, single value mode without an active value * adjust test to ensure we don't have a selected option instead of an active option We still will have an active option (because we default to the first option if nothing is active while the combobox is open). But since we cleared the value when using the `nullable` prop, then it means the `selected` option should be cleared. * ensure `input` event is fired when firing keydown events * ensure `defaultToFirstOption` is always set when going to an option We recently made a Vue improvement that delayed the going to an option, but this also included a bug where the `defaultToFirstOption` was not set at the right time anymore. * update changelog * fix `than` / `then` typo
Headless UI
A set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
Documentation
For full documentation, visit headlessui.com.
Installing the latest version
You can install the latest version by using:
npm install @headlessui/react@latestnpm install @headlessui/vue@latest
Installing the insiders version
You can install the insiders version (which points to whatever the latest commit on the main branch is) by using:
npm install @headlessui/react@insidersnpm install @headlessui/vue@insiders
Note: The insiders build doesn't follow semver and therefore doesn't guarantee that the APIs will be the same once they are released.
Packages
| Name | Version | Downloads |
|---|---|---|
@headlessui/react |
||
@headlessui/vue |
||
@headlessui/tailwindcss |
Community
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
For casual chit-chat with others using the library:
Join the Tailwind CSS Discord Server
Contributing
If you're interested in contributing to Headless UI, please read our contributing docs before submitting a pull request.