-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Support multiple selected items in Listbox. #181
Comments
Hey! Thank you for your feature suggestion! This is something we want to add in the future, but I can't give you an ETA on it yet. Will keep this issue open, thanks for the suggestion! |
+1 for multi-selection w/ |
I also needed a multi-selection Listbox, here's a quick mockup: https://codesandbox.io/s/headlessuireact-listbox-multiple-mockup-widh4 The mockup is basically only using a workaround for selecting and deselecting options including determining the |
@parsch Thanks, I've done something similar in Vue. However, it always closes when clicking on a ListboxOption. Did you figure out any way to prevent that? |
@frandiox You have to replace the default handling of |
Thank you for posting your workaround @parsch! It's working beautifully for me in the codesandbox, but I'm unfortunately having a hard time replicating in v0.3.1 (I wouldn't expect you to maintain this -- just an FYI.) As best I can tell, |
@RobinMalfait - I have the code for this done if you're interested. https://qc1f9.sse.codesandbox.io/listbox/multi if the modelValue is an array the logic automatically allows multi selection. Let me know if you want me to do PR. |
@tctrautman I can reproduce your point when using |
Hey thanks, thats great, but im a it confused, your link include multiple examples that doesnt exist in the actual package, did you code it yourself or i have missed something here? |
Actually, the code provided by @parsch can be easily modified: Just create a separated ListBox Button and add like this: Here is the full Component: https://gist.github.com/landorid/f747c49342dd9eac1b89b251cbe39616 (Also added clickaway listener) |
Would be good to support a multiple selection with tags like this example: https://codesandbox.io/s/headlessuireact-listbox-example-forked-2snzy
Note: the example have a glitch when you remove a selected person from the tag as it's just a concept test |
The link started out with me fixing a bug in the package ( #285 ). Since I was in the code base I added the multiple selection logic to the code. The site was for me to be able to regression test. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Hi, I'm already using the Listbox for a single selection option. Looks and functions well. Would like to be able to reuse this component for a multiple selection as well with the existing OOTB code. Although, I can add the aria-multiselectable option. The existing button doesn't support this feature.
The text was updated successfully, but these errors were encountered: