Keep the Combobox open on Enter/click of an item #1267
-
Hi! First off, thanks for a great library. TL;DR: Is there a way to overwrite Enter or I'm using the Combobox component, and my implementation so far is very similar to the first example here. My custom use case is this: I want to select multiple items from the Combobox list, and show them in My issue is this: When I select an item by pressing Enter, or by clicking the item, the Combobox closes. I assume this is by design, "the selection has been made, so close the Combobox" - however, is there a way to overwrite the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey! Thank you for your suggestion! If you use the insiders builds ( Doing this enables multiple value support which keeps the Combobox open while selecting items. It will also "toggle" items on and off if you press enter on them. More information can be found in the PR: #1243 |
Beta Was this translation helpful? Give feedback.
Hey! Thank you for your suggestion!
Much appreciated! 🙏
If you use the insiders builds (
npm install @headlessui/react@insiders
ornpm install @headlessui/vue@insiders
) there we havemultiple
support available for the Combobox component. You enable it by passing an array to thevalue
instead of a single element.Doing this enables multiple value support which keeps the Combobox open while selecting items. It will also "toggle" items on and off if you press enter on them.
More information can be found in the PR: #1243