angular / angular/components

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

Abierto
#27,260 1 comentario 1 reacción 0 asignados Ver en GitHub
area: material/datepicker area: material/form-field P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la reproducción de StackBlitz en src/app/date-range-picker-forms-example.ts y sigue el flujo de entrada por teclado del selector de rangos de fechas. Reproduce los pasos indicados y, a continuación, verifica que corregir la fecha de inicio elimine el error de validación sin modificar la fecha de finalización.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
angular, typescript
Área
frontend
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.