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

Consider allowing combobox to open menus #2050

Open
scottaohara opened this issue Sep 26, 2023 · 4 comments · May be fixed by #2416
Open

Consider allowing combobox to open menus #2050

scottaohara opened this issue Sep 26, 2023 · 4 comments · May be fixed by #2416
Assignees
Milestone

Comments

@scottaohara
Copy link
Member

This is being asked for consideration for a few reasons:

  1. for better or worse, this can be what current combobox patterns are trying to achieve - a input field that allows for someone to submit a value - but also a popup where on activation of a choice something happens on the page / results are automatically updates / an action performs.
  2. the line between when something is a menuitemradio/checkbox vs an option/multi-selection option can be rather grey - and arguably for multi-select, menuitemcheckboxes with their clear checked/unchecked state can be more understandable than listboxes > options where screen readers have each made their own decisions on when to announce selected vs unselected - under the initial assumption that selection always follows focus.
  3. I could create a combobox that opened a dialog and then that dialog contained a menu within it... there's nothing preventing me from doing that now and it'd be "valid" though a silly workaround to mitigate against the current lack of "allowance" to directly open a menu from a combobox.
@JAWS-test
Copy link
Contributor

This would at least correct how Chrome submits a native HTML select element to the API: as a combobox with menu and menuitem. And it would be closer to the iOS implementation, where the select is rendered as a menu button.

@smhigley
Copy link
Contributor

For a concrete example of this in the wild, the current Fluent UI multiselect combobox opens a menu with menuitemcheckbox children: https://react.fluentui.dev/?path=/docs/components-combobox--default#multiselect

The primary reason for this was that it performed markedly better than listbox/option for multiselect scenarios in a user study.

@cookiecrook
Copy link
Contributor

somewhat related to

@spectranaut spectranaut added this to the 2024 milestone Oct 19, 2023
@spectranaut
Copy link
Contributor

Discussed in today's working group meeting: https://www.w3.org/2023/10/19-aria-minutes.html#t06

Next steps: @mcking65 to make a PR with the change in the title, @scottaohara to make follow up issues for the other points discussed

scottaohara added a commit that referenced this issue Jan 29, 2025
closes #2050

This PR simply adds `menu` to the paragraph of text that indicates what value needs to be used for the aria-haspopup attribute, if the popup is not a listbox:

>authors MUST specify an aria-haspopup value of tree, grid, or dialog that corresponds to the role of its popup.

I think some additional text could be written in the `menu` role definition to further acknowledge this new allowance.  But I'll leave that open for discussion, rather than immediately start adding such text.
@scottaohara scottaohara linked a pull request Jan 29, 2025 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

7 participants