-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material/core): mat-optgroup labels are read twice during screen-…
…reader page navigation. (#21858) Fixed by adding aria-hidden="true" to the <label> elements. While screenreaders will still announce the label text for the group they will skip over the actual label element. Additionally, changed the <label> to a <span> to make it clear that the text is visual only. Co-authored-by: Akshay Verma <[email protected]> (cherry picked from commit ca37709)
- Loading branch information
1 parent
e227ebd
commit fad83cb
Showing
4 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
<label | ||
<span | ||
class="mat-mdc-optgroup-label" | ||
aria-hidden="true" | ||
[class.mdc-list-item--disabled]="disabled" | ||
[id]="_labelId"> | ||
<span class="mdc-list-item__text">{{ label }} <ng-content></ng-content></span> | ||
</label> | ||
</span> | ||
|
||
<ng-content select="mat-option, ng-container"></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
<label class="mat-optgroup-label" [id]="_labelId">{{ label }} <ng-content></ng-content></label> | ||
<span class="mat-optgroup-label" aria-hidden="true" [id]="_labelId">{{ label }} <ng-content></ng-content></span> | ||
<ng-content select="mat-option, ng-container"></ng-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters