question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for DropdownV2 to have categories

See original GitHub issue

Summary

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.

screen shot 2018-10-01 at 10 16 22

(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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:24 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
joshblackcommented, Feb 4, 2020

@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 🤔

1reaction
joshblackcommented, Feb 8, 2020

@dakahn if I understand correctly, I think most variants could need category support, including:

  • Listbox (dropdown)
    • Single select
    • Multi select
  • Combobox
    • Single select
    • Multi select

Not sure about other components, I think we’d need to include them here unless we’re unable to make them work accessibly 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create a drop-down list - Microsoft Support
You can help people work more efficiently in worksheets by using drop-down lists in cells. Drop-downs allow people to pick an item from...
Read more >
Categories, Filters & Dropdowns - CMU Web
Dropdown menus can be added to special index page types (Bio Index, News Index, Course Index) for category filtering by website visitors. Dropdown...
Read more >
wp_dropdown_categories() | Function
Displays or retrieves the HTML dropdown list of categories. Contents. Description; Parameters; Return; More Information; Source; Hooks; Related. Uses; Used By.
Read more >
Organizing drop-down list options - Zendesk help
I wanted to add a dropdown field that had our full client list. We don't have 2000 values at the moment but planning...
Read more >
How to Create a Dependent Drop Down List in Excel
It shows a list of items as a drop down in a cell, and the user can make a selection from the drop...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found