Skip to content

Commit 326e46e

Browse files
author
Akshay Verma
committed
fix(material/core): mat-optgroup labels are read twice during screen-reader page navigation.
Fixed by adding aria-hidden="true" to the <label> elements, so that while screenreaders will still announce the label text for the group (due to the aria-labelledby property on mat-optgroup), 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 and not carrying any special semantic meaning for the a11y tree.
1 parent 0930dc3 commit 326e46e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<label class="mat-optgroup-label" [id]="_labelId">{{ label }} <ng-content></ng-content></label>
1+
<span class="mat-optgroup-label" aria-hidden="true" [id]="_labelId">{{ label }} <ng-content></ng-content></span>
22
<ng-content select="mat-option, ng-container"></ng-content>

0 commit comments

Comments
 (0)