Add support for DropdownV2 to have categories
See original GitHub issueSummary
In Dropdown we managed to get categories of items rendered like so, by using fake items in the data structure, and ignoring the click events etc.
(This example is from existing public functionality and shows a list of places a slack message could be sent. After the end of the list of channels, you see the category heading ‘USERS’ followed by a list of selectable user options).
In DropdownV2 we have to pass in just an array of plain objects that, as far as I can see, have no way of specifying categories. We need to be able to specify categories to migrate to DropdownV2. Ideally we don’t want to have to hack them in either, but instead have first class support like the Select
component does.
Justification
Dropdown is disappearing, and being replaced with DropdownV2. This would also provide feature parity with the Select
carbon component.
Desired UX and success metrics
Items should be able to be grouped under unselectable categories. This provides structure to what could be a long list of otherwise indistinguishable options. Ideally it should look similar to what we have for our existing Dropdown
usage.
“Must have” functionality
- Ability to provide category information in some format.
- Categories should not be selectable
- Categories should be rendered differently to provide differentiation.
Specific timeline issues / requests
Before Dropdown disappears.
Available extra resources
It’s unclear if we’ll have the time or resource to implement such functionality ourselves - even if we can reach an agreement here for how categories should be injected and styling should look.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:24 (16 by maintainers)
Top GitHub Comments
@tw15egan I think we definitely want to, but IIRC there were some issues with a11y that @dakahn flagged. I think on our end we wanted to fix up the a11y issues in these components first and then move forward with category support emulating: https://dequelabs.github.io/combobo/demo/ but I’m not sure if there was a hiccup with that and screen readers, or not, so will defer to DA 🤔
@dakahn if I understand correctly, I think most variants could need category support, including:
Not sure about other components, I think we’d need to include them here unless we’re unable to make them work accessibly 🤔