-
Notifications
You must be signed in to change notification settings - Fork 796
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
Permit ARIA 1.2 combobox (without textbox child) #2505
Comments
Thanks for the issue. We've been discussing this very pattern over in #2478. The TL;DR is that we want to support the pattern, but we need to figure out what to do with the old 1.1 pattern first. |
Thanks @straker. I took a look at #2478 and just want to understand the 1.1 blocker a bit better. Would it be feasible to support
From what I can tell, adding support (in the form of not flagging as a violation) for the 1.2 pattern could be done independently of whether the 1.1 pattern should be sunset here. The practice of putting aria-controls on the |
The main blocker is that it will require special casing and an edge case of guessing. First, which roles require owning other roles is dictated by our aira-roles standards object. In ARIA 1.0 and 1.1, the combobox is required to own a listbox and textbox (with 1.1 also allowing grid, tree, and dialog if used with Secondly, there is an edge case when the input has both If we flag it as a 1.0 pattern then we need to make sure it owns a listbox, if it doesn't we flag it as a missing required-child. But if the author intended the 1.2 pattern it should pass. If the author intended the 1.2 pattern, should we tell them to remove the Hopefully that helps clarify the blocker. We have this planned to be fixed for our 4.1.0 release, so we should be working on it in the coming weeks. |
Thanks for the discussion, @straker. That make sense to me. It's unfortunate the singular churn of combobox role makes a static mapping hard for axe. I can imagine creating a different ruleset for My vote regarding the Anyway sounds like your team is on top of it, so thank you and let me know if you need any help or testing from our side. |
Given the poor support for the 1.1 combobox pattern, and the recommendation explicitly in 1.2 to not use the 1.1 pattern, could the |
For another example, here's a demo using angular material that gets flagged in axe: https://angular-ph3vth-e514sq.stackblitz.io/. In this example, the listbox is dynamically created (axe complains it doesn't have the right child) then continues to flag in the open state. I assume it's because the listbox isn't the first child (nested in a div). The listbox is directly linked with If this example is accessible, then the rule |
@straker / @WilcoFiers I did some testing, and I think axe wouldn't require any special casing or version detection to make this work well. I created a few combobox variations of the 1.1 and 1.2 patterns that mix and match having a child input and switching As you can see, there is no practical support problem with removing the child input for the 1.1 pattern, or leaving out
It seems like if axe removed the This makes sense from a technical perspective: the thing doing the heavy lifting is |
Thanks for all the amazing tests! I talked with @WilcoFiers and we agree that your suggestion seems like the best approach. We'll see about getting this into the 4.2 release. |
Woot, thanks so much! 🎉 |
Unfortunately, we had to postpone this one, will take this up in 4.3. |
Just a heads up. This is going into the 4.3 release happening next week. |
Seems, this recent update might have changed some other aspects of combobox validation in a way that was not a problem before. Suddenly, Fluent UI's dropdowns started to be highlighted with 'aria-required-children' rule based on missing 'aria-controls' attribute in collapsed state. If I understand correctly the part of WAI-ARIA that the rule refers to in part applicable to combobox, it mentions that
i.e. 'aria-controls' is only required when the combobox is in expanded state (which mentioned dropdown implementation complies with, as the listbox part is dynamically inserted and not present in the DOM before expansion). There are no other mentions of these attributes with regards to behavior in a collapsed state. But axe-core requires those attributes unconditionally. I'd like to ask if my understanding is correct or am I missing something? Once confirmed, I'd be happy to work on a patch. |
Thanks for letting us know. It does indeed look like we missed that as part of the implementation. Would you mind opening a new issue so we can track it? |
Ooops, sorry, did not see you've created one and opened #3091. Will close as a dupe. |
Expectation: A compliant ARIA 1.2 (draft) combobox should not raise axe violations.
Actual: ARIA 1.2 combobox raises aria-required-children violation. Demo: https://w3c.github.io/aria-practices/examples/combobox/combobox-select-only.html. Currently raises 1 violation, aria-required-children.
Motivation: ARIA 1.2 is redefining combobox (draft spec) to no longer require a textbox child because of various issues with the 1.1 combobox. Aside from resolving long-standing labelling and SR support issues, this is particularly useful for web applications that want to emulate a native select or provide a rich selection widget (e.g. a form select with a popup that includes multiselection, options filter, select all/none). The current common practice is to use a popup button as the trigger rather than a combobox, but this is problematic in a form setting because button has problems with
aria-required
(prohibited by spec, flagged by axe, though supported in practice) andaria-invalid
(permitted by spec, but not supported in practice). I've tested the new pattern with combobox trigger on JAWS, NVDA, ChromeVox on ChromeOS, VoiceOver, iOS VoiceOver, and Android TalkBack, and they all correctly announce current value, requiredness, and invalidness. In light of the apparent widespread support and that it's in a draft spec, it would be nice to permit it in axe. A couple of projects I'm involved with including Angular Material have already cut over to the new pattern because of the clear a11y wins, and we're currently suppressing (in tooling) and manually ignoring (when using axe extension) the axe violation.The text was updated successfully, but these errors were encountered: