Skip to content

Commit 602bef1

Browse files
authored
fix(material/datepicker): replace labels not pointing to anything (#29755)
Fixes that the datepicker had some `<label>` elements that weren't pointing to anything via the `for` attribute which was being flagged by Chrome. Fixes #29749.
1 parent 0ed5d7d commit 602bef1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/material/datepicker/calendar-body.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
</tr>
8585
}
8686

87-
<label [id]="_startDateLabelId" class="mat-calendar-body-hidden-label">
87+
<span [id]="_startDateLabelId" class="mat-calendar-body-hidden-label">
8888
{{startDateAccessibleName}}
89-
</label>
90-
<label [id]="_endDateLabelId" class="mat-calendar-body-hidden-label">
89+
</span>
90+
<span [id]="_endDateLabelId" class="mat-calendar-body-hidden-label">
9191
{{endDateAccessibleName}}
92-
</label>
92+
</span>

src/material/datepicker/calendar-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- [Firefox Issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1880533]
44
Relocated label next to related button and made visually hidden via cdk-visually-hidden
55
to enable label to appear in a11y tree for SR when using Firefox -->
6-
<label [id]="_periodButtonLabelId" class="cdk-visually-hidden" aria-live="polite">{{periodButtonDescription}}</label>
6+
<span [id]="_periodButtonLabelId" class="cdk-visually-hidden" aria-live="polite">{{periodButtonDescription}}</span>
77
<button mat-button type="button" class="mat-calendar-period-button"
88
(click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel"
99
[attr.aria-describedby]="_periodButtonLabelId">

0 commit comments

Comments
 (0)