Skip to content
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

ListBox with selectionMode="multiple" not working inside Combobox component #6570

Open
tordsta opened this issue Jun 19, 2024 · 2 comments
Open

Comments

@tordsta
Copy link

tordsta commented Jun 19, 2024

Provide a general summary of the issue here

I think the core of the issue is that the behavior of ListBox should be consistent when placed inside different wrappers such as ComboBox. This is also relevant for ListBox inside the Select component. I know the docs specify that multiple selections is not possible for the Select component, but it is still weird and confusing that one can have a ListBox with the selectionMode="multiple" inside a Select component. Furthermore I can not find the same single select restriction in the documentation for ComboBox or ListBox, leading me to believe this is a bug.

🤔 Expected Behavior?

ListBox with selectionMode="multiple" does not work inside a Combobox.

😯 Current Behavior

ListBox with selectionMode="multiple" does not work inside a ComboBox.

💁 Possible Solution

Some alternatives:

  1. Make the ListBox with selectionMode="multiple" work inside ComboBox. I guess the value would need to be an array of keys instead of a single key to make it work.
  2. If this is intended behavior, update the documentation of ComboBox and ListBox. Specify that ComboBox is single select. On the ListBox page add a "Gotcha"/warning about selectionMode="multiple" not working when placed inside Select and ComboBox.

🔦 Context

Filter with multiple options selected.
Selection of multiple floors a tenant is on.
Etc. just dropdown multi select in general.

🖥️ Steps to Reproduce

https://codesandbox.io/p/sandbox/awesome-dawn-n8p4pn

Version

1.2.1

What browsers are you seeing the problem on?

Other

If other, please specify.

Arc

What operating system are you using?

macOS Sonoma 14.1

🧢 Your Company/Team

Propely

🕷 Tracking Issue

No response

@tordsta
Copy link
Author

tordsta commented Jun 19, 2024

Also another possible solution is to separate out the ListBox into two different concepts. One that is ListBox with ListBoxItems, with a selectionMode="multiple". And another one that is OptionBox (or whatever) and OptionBoxItem witch is only single select. And then using OptionBox in ComboBox and Select, while ListBox is standalone.

@snowystinger
Copy link
Member

Related #2140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants