-
Notifications
You must be signed in to change notification settings - Fork 334
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
Question: menu/menuitem vs. listbox/option (or something else?) for filter/sort pattern #2584
Comments
But now to the actual question of which of the two variants to use. I think the two variants I mentioned are correct, but I would prefer a button that opens a menu, because
|
Great points @JAWS-test! I think I initially got the role of So based on your points, implementing either of these patterns would work here:
Just to clarify, because we're not within a proper I guess one other difference between the two here would be that with the Select-only Combobox, you can mark the control as "required" (alongside a required label), which would make sense in a proper form scenario. Would love to see more examples/docs "Use Cases" for patterns as I find it difficult to differentiate many of these similar (but different) components! For example, something like this diagram from https://css-tricks.com/striking-a-balance-between-native-and-custom-select-elements/ which would have an associated ARIA pattern: Anyway, I'll close this for now but feel free to add any additional thoughts. Thanks for your help 👍 |
@JAWS-test Curious then in the following example taken from https://www.deque.com/company/careers/ - where selecting an option from one of the dropdowns does NOT automatically update the content of the page. And instead, you have to click "Filter" to apply the selected filters. Would then a Select-only Combobox make the most sense here? |
Yes, in that case I would use select size=1 or select-only comboboxes - just because of the fact that there is a submit button |
Funny how Deque's elements are wrong when they should know how to do it right. They are using listbox which also don't have proper labels. Also, they use aria-haspopup on the listbox, which is no longer allowed with ARIA 1.2... |
I'm looking for some guidance on which accessibility pattern to use for a filter/sort dropdown menu.
For example, a page where there is a section of user-submitted reviews where there is a sort dropdown - e.g. Sort by: [Most Recent|Top Reviews|etc]. When a user clicks one of the sort options, the section automatically updates with the sorted reviews. The user does not have to click on a "Apply filter" button to update the content.
Here's a visual example:
Amazon implements this pattern with
listbox
/option
roles - similar to that of a<select>
element. However, combing across other popular sites (e.g. Google), I've seen this pattern implemented withmenu
/menuitem
ormenuitemradio
roles.I apologize in advance if this is covered somewhere, but what types of conditions should we be looking for to decide when to use a
menu
overlistbox
? Is it based on the intent/purpose of the individual items? the context in which it is used - e.g. within a form?The text was updated successfully, but these errors were encountered: