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

bug(MatTooltip): A11y - Screen readers landmark issue with matTooltip #21173

Open
nirkai opened this issue Nov 30, 2020 · 4 comments
Open

bug(MatTooltip): A11y - Screen readers landmark issue with matTooltip #21173

nirkai opened this issue Nov 30, 2020 · 4 comments
Labels
Accessibility This issue is related to accessibility (a11y) area: material/tooltip P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@nirkai
Copy link

nirkai commented Nov 30, 2020

Reproduction

When using the matTooltip screen readers confused about the landmark and duplicate the announcement (e.g. main, list, group etc.).
This can make a lot of confusion for visually impaired users.

https://stackblitz.com/edit/angular-gizwqa?file=src%2Fapp%2Ftooltip-overview-example.html

Steps to reproduce (in the example above):

  1. Navigate to the first button with keyboard (using Tab key).
  2. Screen reader will announce the new landmark, the button and the tooltip: My buttons grouping Button1 button Info about the action
  3. Navigate to second and last buttons, in the last button the landmark will be announced again.
  4. Navigate only throw 2 last buttons - the screen reader will announce only the button as expected.
  5. Navigate to the first button - the landmark will be announced again (and so on the last 3 button).

Expected Behavior

Screen readers will announce the landmark only once (when entering to the landmark)
In the example:

  • My buttons grouping Button1 button Info about the action
  • Button2 button
  • Button3 button

Actual Behavior

Screen readers duplicated the announcement.
In the example:

  • My buttons grouping Button1 button Info about the action
  • Button2 button
  • My buttons grouping Button3 button

Environment

  • Angular: 11.0.2 (also in V10)
  • CDK/Material: 11.0.1
  • Browser(s): Chrome V87
    (tested with NVDA in Firefox and worked as expected).
  • Screen readers: NVDA V2020.2, JAWS 2020
@nirkai nirkai added the needs triage This issue needs to be triaged by the team label Nov 30, 2020
@crisbeto
Copy link
Member

I could reproduce it against NVDA as well. From what I can tell, the problem comes from the fact that our aria-describedby elements are in a different landmark than the element they're describing.

@crisbeto crisbeto added Accessibility This issue is related to accessibility (a11y) area: material/tooltip P2 The issue is important to a large percentage of users, with a workaround and removed needs triage This issue needs to be triaged by the team labels Nov 30, 2020
@nirkai
Copy link
Author

nirkai commented Nov 30, 2020

@crisbeto I also thought in that direction, but I have checked it with the cdk AriaDescriber service too.
This issue didn't reproduce without the tooltip.

@crisbeto
Copy link
Member

That's odd since the AriaDescriber is basically the only accessibility treatment that we're doing on the tooltip. I tried to use aria-describedby directly myself and I couldn't reproduce it when the description was within the landmark.

@nirkai
Copy link
Author

nirkai commented Nov 30, 2020

I know, couldn't figured yet what the root of this problem.
Could it be connected to the removing/adding the mat-tooltip to the cdk-overlay-container in DOM?

Here is a quick example of both MatTooltip and AriaDescriber:

@jelbourn jelbourn self-assigned this Dec 7, 2020
@zarend zarend added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P2 The issue is important to a large percentage of users, with a workaround labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility This issue is related to accessibility (a11y) area: material/tooltip P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

4 participants