angular / angular/components

bug(datepicker): Date range input by keyboard validation is incorrect

Ouverte
#27,260 1 commentaire 1 réaction 0 personnes assignées Voir sur GitHub
area: material/datepicker area: material/form-field P3
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

On a date range picker, write dates in incorrect order (start > end) like `01/01/2012 - 01/01/2011`. The component shows a validation error. After correcting the start date using the keyboard to `01/01/2010`. The error isn't removed until the end date is modified, even setting the same end date using the keyboard.

### Reproduction

StackBlitz link: https://stackblitz.com/run?file=src%2Fapp%2Fdate-range-picker-forms-example.ts
Steps to reproduce:
1. Focus on the start date field.
2. Write (keyboard input) `01/01/2012`
3. Tab to change focus to the end date input field.
4. Write (keyboard input) `01/01/2011`
5. Shift+Tab to return to the start date field.
6. The validation error is shown.
7. Write (keyboard input) `01/01/2010` on the start field.
8. Tab to change focus to the end date input field.order.
9. The validation error is still present even when the dates are in correct order.
10. Delete anything on the end date and add what you deleted again, to have the same end date as before.
11. The validation error disappear.

### Expected Behavior

Correcting the start date on step 7 should fix validation error.

### Actual Behavior

Correcting the start date on step 7 doesn't fix the validation error.

### Environment

@angular-devkit/architect 0.1600.3
@angular-devkit/build-angular 16.0.3
@angular-devkit/core 16.0.3
@angular-devkit/schematics 16.0.3
@angular/cdk 16.0.2
@angular/material 16.0.2
@schematics/angular 16.0.3
ng-packagr 16.0.1
rxjs 7.8.1
typescript 5.0.4

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par la reproduction StackBlitz dans src/app/date-range-picker-forms-example.ts et suivez le chemin de saisie au clavier du sélecteur de plage de dates. Reproduisez les étapes indiquées, puis vérifiez que la correction de la date de début efface l’erreur de validation sans modifier la date de fin.

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
38/100

Recevez les nouvelles issues par e-mail

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