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

fix(material/select): NVDA reading out table when opening select on Chrome #21492

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jan 5, 2021

The mat-select trigger element has an aria-owns pointing to the overlay and display: inline-table in its CSS. The combination of these two causes Chrome to infer the element as a table which results in NVDA reading out "table" any time a select is opened.

These changes resolve the issue by setting the element to role="presentation". I've tested out the change against NVDA and VoiceOver and it doesn't seem to affect the accessibility of the select, apart from the "table" not being read out anymore.

Fixes #21480.

For reference, here's what Chrome's constructed a11y node looks like at the moment (note the LayoutTable).

Example

…hrome

The `mat-select` trigger element has an `aria-owns` pointing to the overlay and
`display: inline-table` in its CSS. The combination of these two causes Chrome to infer
the element as a `table` which results in NVDA reading out "table" any time a select is
opened.

These changes resolve the issue by setting the element to `role="presentation"`. I've
tested out the change against NVDA and VoiceOver and it doesn't seem to affect
the accessibility of the select, apart from the "table" not being read out anymore.

Fixes angular#21480.
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent Accessibility This issue is related to accessibility (a11y) target: patch This PR is targeted for the next patch release labels Jan 5, 2021
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jan 5, 2021
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added the action: merge The PR is ready for merge by the caretaker label Jan 5, 2021
-->
<div cdk-overlay-origin
[attr.aria-owns]="panelOpen ? id + '-panel' : null"
role="presentation"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crisbeto It seems axe is not happy that this has both role=presentation and aria-owns

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the option of excluding it? I don't get the error when running the axe extension locally so it's either an old version or an option that people have to opt into. The alternative would be to remove the display: inline-table from the CSS, but I suspect that'll cause a bunch of screenshot diff failures instead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the rule that's triggered: https://dequeuniversity.com/rules/axe/4.1/presentation-role-conflict. It's listed as a minor thing, so I'm guessing maybe the app has stricter rules enabled than we do

@mmalerba mmalerba removed the action: merge The PR is ready for merge by the caretaker label Jan 19, 2021
@crisbeto
Copy link
Member Author

Closing in favor of #23446.

@crisbeto crisbeto closed this Aug 25, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(MatSelect): NVDA announce 'table' when select options opened
3 participants