-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
fix(select): use combobox pattern for accessibility #20082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b2c347a
to
8669172
Compare
So this has ~100 failing targets in Google from about 20 projects. I haven't looked too deeply, but it seems like a lot of people wrote selectors in their tests like |
Something to keep in mind about those selectors: people were probably trying to target a select with a specific placeholder. The select currently in master forwards its |
Can we do the same thing as input and temporarily put that information into another attribute, then switch tests over to it? E.g. |
Have we confirmed that it's due to the selector? If that's the case, it's easy to add a similar attribute. |
8669172
to
69dc621
Compare
69dc621
to
7f3cd79
Compare
I'm seeing violations that the https://dequeuniversity.com/rules/axe/3.5/aria-required-children?application=axeAPI Does that apply here? Is this check incorrect in this case? |
Another set of failing accessibility errors gave me this:
|
The second one we should be able to fix in the PR, I think. For the first one, the check is kind of problematic itself because we're following the draft ARIA 1.2 guidance on this. While this isn't the official ARIA spec today, it actually works better in most screen-readers than the active 1.1 spec. |
If it works better, we can disable the check, open an issue internally, and link to it with a TODO? |
7f3cd79
to
6cc97f6
Compare
I've pushed a fix for the second error, but we can't do much about the first one. |
Here's a fun use case that causes an |
I think three failures came up for accessibility:
(1) should be handled by disabling the check since the test's ax check is just out of date for now Is there anything we can do about (2)? |
Does it say which elements 2 and 3 are failing on? I pushed some changes last week that should've removed references to elements that aren't in the DOM yet. |
6cc97f6
to
195f15e
Compare
Applies some of our recent learnings on how to handle the accessibility of a custom select to `mat-select`. Includes switching the trigger to be a `combobox` and the panel to a `listbox`. Fixes angular#11083.
195f15e
to
d9214df
Compare
Updated to fix the issue with |
Applies some of our recent learnings on how to handle the accessibility of a custom select to `mat-select`. Includes switching the trigger to be a `combobox` and the panel to a `listbox`. Fixes angular#11083.
I am seeing a critical violation 'Certain ARIA roles must contain particular children' (https://dequeuniversity.com/rules/axe/3.5/aria-required-children?application=AxeChrome) on https://material.angular.io/components/select/overview when analyzing with Axe Core. I thought this PR was intended to fix that issue? |
If I remember correctly, the only error right now is that the combobox doesn't contain an |
Yeah, we're a little ahead of axe here. See dequelabs/axe-core#2505 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Applies some of our recent learnings on how to handle the accessibility of a custom select to
mat-select
. Includes switching the trigger to be acombobox
and the panel to alistbox
.Fixes #11083.