Skip to content

fix(material/radio): hide supporting elements from assistive technology#32816

Open
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:fix/radio-button-aria-hidden
Open

fix(material/radio): hide supporting elements from assistive technology#32816
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:fix/radio-button-aria-hidden

Conversation

@yogeshwaran-c
Copy link

What kind of change does this PR introduce?

Bug fix (accessibility).

What is the current behavior?

VoiceOver on macOS reads the decorative div elements inside mat-radio-button (touch target, radio circle background, and ripple container) as "group", creating unnecessary navigation stops when using a screen reader to navigate through a radio group. Each radio button results in multiple "group" announcements instead of just the expected radio button label and state.

Closes #32797

What is the new behavior?

The three supporting visual elements inside mat-radio-button now have aria-hidden="true":

  • .mat-mdc-radio-touch-target -- expanded hit area for touch interaction
  • .mdc-radio__background -- visual radio circle (outer/inner circles)
  • .mat-radio-ripple -- ripple effect container

This hides them from the accessibility tree so screen readers only announce the semantically meaningful <input type="radio"> and <label> elements, resulting in one clean navigation stop per radio button.

Additional context

This follows the same pattern used by mat-checkbox, which marks its decorative SVG checkmark with aria-hidden="true" (see checkbox.html line 33 and checkbox.spec.ts line 61-64).

A unit test has been added to verify all three elements have the aria-hidden="true" attribute.

Files changed:

  • src/material/radio/radio.html -- Added aria-hidden="true" to 3 decorative elements
  • src/material/radio/radio.spec.ts -- Added test verifying aria-hidden attributes

Add `aria-hidden="true"` to the touch target, background, and ripple
elements inside mat-radio-button. These are purely visual/interaction
elements that VoiceOver on macOS incorrectly reads as "group", creating
unnecessary navigation stops for screen reader users.

Closes angular#32797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant