components icon indicating copy to clipboard operation
components copied to clipboard

bug(mat-form-field): VoiceOver reads multiple group, set aria-hidden to supporting elements

Open d-timur-reply opened this issue 9 months ago • 2 comments

Is this a regression?

  • [ ] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

related to #32797

Supporting elements in MatFormField should have aria-hidden="true" here because they do not contribute to accessibility. I suggest the "Ripple" family of components, in this case selector matformfieldlineripple but also in all other places, to automatically add aria-hidden="true".

If hints and errors are empty, MatFormField still renders a hint wrapper, which then would read as an empty "group". In this case, this wrapper should also be "aria-hidden="true".

Reproduction

StackBlitz link: https://stackblitz.com/edit/components-issue-starter-cudkchbv?file=src%2Fmain.ts Steps to reproduce:

  1. enable VoiceOver
  2. navigate through elements

Expected Behavior

At best, it should should skip the first "input", directly read "Input, edit text" and after that "test"

Actual Behavior

VoiceOver is reading the following at each navigation step:

  1. Input
  2. Input, edit text
  3. group
  4. group

Environment

  • Angular: tested with 18 and 20
  • CDK/Material: tested with 18 and 20
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS 26

d-timur-reply avatar Feb 25 '26 14:02 d-timur-reply

How are you navigating through it to see the groups? At least with tabbing I couldn't get VoiceOver to read them out.

crisbeto avatar Feb 25 '26 19:02 crisbeto

Yes, that is because tabbing would only consider tabbable elements / tabindex (interactive elements). However screen reader users might navigate any item in the accessibility tree. In the end, a screen reader serves all available information and not only interactive elements.

To test this in VoiceOver, I step through apps with Option+Control (VoiceOver modifier) and Arrow (left, right) as this is configured in my settings. See VoiceOver Utility.app > Commands > VoiceOver modifier

d-timur-reply avatar Feb 26 '26 14:02 d-timur-reply