Closed jones1008 closed 17 hours ago
mat-calendar-body-active
indicates where the keyboard focus is, not that a date is selected. It only has a visual effect when navigating with the keyboard. The selected date gets the class so that when the user tabs away and comes back, their focus will pick up from where they were.
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When selecting a date in the datepicker (e.g. 1st of october), this day of month of every other month (e.g. 1st of september or 1st of november) has a
button
element with the classmat-calendar-body-active
which is probably wrong, because it is not active. As far I can see, this bug does not have any visual clues that it's happening but the class is still applied on wrong places.Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-starter-94uee3?file=src%2Fmain.ts Steps to reproduce:
mat-calendar-body-active
on thebutton
element.Expected Behavior
Only the
button
of the selected day should have the classmat-calendar-body-active
.Actual Behavior
When some day is selected in the datepicker (e.g. 1st of october), in every other month this day of month (e.g. 1st of november) has the class
mat-calendar-body-active
too, which is probably wrong, since it is not 'active'.Environment