angular / angular/components

bug(mat-datepicker): calendar with startAt attribute will not update on manual input

Ouverte
#28,814 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
area: material/datepicker P4
Langage dominant
TypeScript
Étoiles
25k
Forks
6.8k
Merge moyen
1 j 8 h
PR mergées (30 j)
91

Description

### 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

I built a mat-datepicker with startAt property (e.g. 01/01/2024).
Calendar starts as described in documentation at demanded calendar page.
If input value is changed, calendar will not update to desired page. (e.g. date is changed to 05/05/2024, calendar page is still on January 2024 instead of May 2024)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/datepicker-property-error
Steps to reproduce:
1. Change input to any other date (e.g. 5/5/2024) either by typing or selection on calendar.
2. (Re-)Open calendar.

### Expected Behavior

Calendar should switch to page of desired month (e.g. May 2024).
startAt property should only set initial date and react accordingly to changes.

### Actual Behavior

Calendar does not change its page according to the input date. It remains on startAt date.

### Environment

- Angular: v17
- CDK/Material: 17.3.1
- Browser(s): Chrome, Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par reproduire le comportement dans le StackBlitz lié et examinez le point d’entrée de mat-datepicker pour voir comment startAt et la saisie manuelle affectent le mois affiché. Vérifiez la saisie ou la sélection d’une nouvelle date, puis confirmez qu’à la réouverture du calendrier, celui-ci affiche le mois de la date saisie, tandis que startAt ne contrôle que la page initiale.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
angular, typescript
Domaine
frontend
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.