useComboBoxState with multiple selection #1637
-
I want to create a combobox with multiple selection similar to this example from Downshift. However, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Our combobox specifically only supports single selection because it is hard to show multi selection in a combobox. The component you shared shows it via a taglist and removes selected items from the combobox options. As such, when we build a similar component, we'll probably create a different hook that can handle multi selection. You could also create your own tags and use the ComboBox in a controlled manner, handling onSelectionChange to reset the input value and add to the tags. We don't have a taglist component yet, so you'd need to follow the aria specs for layout grids yourself for that. |
Beta Was this translation helpful? Give feedback.
Our combobox specifically only supports single selection because it is hard to show multi selection in a combobox. The component you shared shows it via a taglist and removes selected items from the combobox options. As such, when we build a similar component, we'll probably create a different hook that can handle multi selection.
You could also create your own tags and use the ComboBox in a controlled manner, handling onSelectionChange to reset the input value and add to the tags. We don't have a taglist component yet, so you'd need to follow the aria specs for layout grids yourself for that.