angular / angular/components

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

Offen
#27,260 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
area: material/datepicker area: material/form-field P3
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

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der StackBlitz-Reproduktion in src/app/date-range-picker-forms-example.ts und verfolge den Pfad der Tastatureingabe für den Date-Range-Picker. Führe die aufgeführten Schritte aus und überprüfe anschließend, dass das Korrigieren des Startdatums den Validierungsfehler löscht, ohne das Enddatum zu ändern.

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

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.