Skip to content

Commit 2227150

Browse files
committed
fix(material/datepicker): multi-year view changes in datepicker doesn't announce selected year range
Fixes a bug in the Angular Material component where when the selected year range is updated by moving foward to the next range or by moving to the previous range the screenreader announces the original date range rather than the newly selected date range. This because the class was removing the new value from the Firefox accessibility tree. Fixes #28360
1 parent ba57666 commit 2227150

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

src/material/datepicker/calendar-header.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="mat-calendar-header">
22
<div class="mat-calendar-controls">
3+
<label [id]="_periodButtonLabelId" class="cdk-visually-hidden">{{periodButtonDescription}}</label>
34
<button mat-button type="button" class="mat-calendar-period-button"
45
(click)="currentPeriodClicked()" [attr.aria-label]="periodButtonLabel"
56
[attr.aria-describedby]="_periodButtonLabelId" aria-live="polite">
@@ -25,4 +26,3 @@
2526
</button>
2627
</div>
2728
</div>
28-
<label [id]="_periodButtonLabelId" class="mat-calendar-hidden-label">{{periodButtonDescription}}</label>

src/material/datepicker/calendar.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,3 @@ $_tokens: tokens-mat-datepicker.$prefix, tokens-mat-datepicker.get-token-slots()
174174
content: '';
175175
}
176176

177-
// Label that is not rendered and removed from the accessibility tree.
178-
.mat-calendar-hidden-label {
179-
display: none;
180-
}

0 commit comments

Comments
 (0)