bug(MatCalendar): updating dateClass does not update calendar view
- Vorherrschende Sprache
- TypeScript
- Sterne
- 25k
- Forks
- 6.8k
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 91
Beschreibung
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
We have displayed a calendar and when changing the month we load data from the backend to highlight certain cells.
We tried to update the `dateClass` using observables together with the async pipe which did not work since the calendar is not updating when the reference changes.
A workaround was to call `setLocale` of the date adapter which triggers a rerender.
I consider this a bug and not a feature because it is not mentioned anywhere that this cannot be done and `dateFilter` also can be updated asynchronously.
### Reproduction
StackBlitz link:
Steps to reproduce:
1.
2.
### Expected Behavior
Update calendar view on `dateClass` change
### Actual Behavior
calendar view does not update when `dateClass` changes.
### Environment
- Angular: 17.3.0
- CDK/Material: 17.3.0
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): MacOS
Beitragsleitfaden
Rechercherichtung
Beginne beim Einstiegspunkt MatCalendar und reproduziere den gemeldeten Fall mit einem sich asynchron ändernden dateClass-Wert. Überprüfe, dass die Änderung des Werts die gerenderten Kalenderzellen aktualisiert, ohne auf den setLocale-Workaround des Date-Adapters angewiesen zu sein; im Issue wird keine Quelldatei oder kein Test genannt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- angular, typescript
- Bereich
- frontend
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100