Is it possible to pick multiple elements with useSelectState? #2218
Unanswered
marcus-josendal
asked this question in
Q&A
Replies: 1 comment 2 replies
-
At the moment it's not possible. useSelect only allows single selection. It's pretty much emulating a That said, you can use the list box hook separately. The source for useSelect itself isn't that complex either since it just combines a lot of other hooks, so you could pretty easily build a custom version. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The documentation for
useSelect
says the following: In addition, useSelectState manages the state necessary for multiple selection and exposes a SelectionManager.If you try to set one key with the
selectionManager
it works as expected:If you try to set multiple keys it ignores one of the keys:
It seems that if you want multiple selections you have to use the use
useListBox
hook, but this hook doesn't include popover and accessibility features theuseSelect
hook offers.Beta Was this translation helpful? Give feedback.
All reactions