Multi select option in useComboBox hook #2162
-
Hey folks! I am using useComboBox hook from I found a similar ongoing discussion here, but is there any example or repo that implements the approach mentioned in the discussion? Can we handle the multi-selection without actually forking and updating the EDIT: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Please see #2140. Multiple selection is not built in at the moment. One possibility is to handle selection events from the combobox yourself, add the item to a list you maintain in your own state, and render that yourself outside the combobox somewhere. If you make the combobox controlled you could also clear the input when selection occurs and the item is added to your own selection state.
Yes. It should work with any modern bundler. You can also choose to import each package individually (e.g. |
Beta Was this translation helpful? Give feedback.
Please see #2140. Multiple selection is not built in at the moment. One possibility is to handle selection events from the combobox yourself, add the item to a list you maintain in your own state, and render that yourself outside the combobox somewhere. If you make the combobox controlled you could also clear the input when selection occurs and the item is added to your own selection state.
Yes. It should work with any modern bundler. You can also choose to import each package individually (e.g.
import {useComboBox} from '@react-aria/combobox'
rather thanimport {useComboBox} from 'react-a…