Skip to content

Is Combobox Form Submit possible? #1349

Answered by RobinMalfait
gregrafferty asked this question in Help
Discussion options

You must be logged in to vote

Hey! Thank you for your question!
Much appreciated! 🙏

We did a lot of improvements and fixes, for example in the Combobox there will always be an active option when the Combobox is open. When the Combobox is closed, then pressing enter allows you to submit a form. You can also provide a name prop to the component which gives you native form compatibility.

Here is an interactive example: https://headlessui-react-eqob3t5b8-tailwindlabs.vercel.app/combinations/form
Here is the code for it:

<Combobox
name="location"
value={activeLocation}
onChange={(location) => {
setAc…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gregrafferty
Comment options

Answer selected by gregrafferty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants