Skip to content

Commit

Permalink
fix(material/core): Fix MacOS Hover feature compatibility with optgro…
Browse files Browse the repository at this point in the history
…up (#27239)

Corrects ARIA semantics for the mat-optgroup component. Add
role="presentation" to the label and remove aria-hidden="true" from the
label.

Fix compatibility issue with MAC Hover text a11y feature #27080. The
label of the option group does not need to be aria-hidden, and the Mac
Hover text feature seems to rely on it.

Previous PR#27081 fixed this issue for legacy component. This PR fixes it for
the non-legacy optgroup component.

Fix #27080

(cherry picked from commit 91fbe76)
  • Loading branch information
zarend committed Jun 6, 2023
1 parent 2c660bb commit f595c78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/material/core/option/optgroup.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<span
class="mat-mdc-optgroup-label"
aria-hidden="true"
role="presentation"
[class.mdc-list-item--disabled]="disabled"
[id]="_labelId">
<span class="mdc-list-item__primary-text">{{ label }} <ng-content></ng-content></span>
Expand Down

0 comments on commit f595c78

Please sign in to comment.