angular / angular/components

Bug: Datepicker value change event fires when changing min value of it

Abierto
#9,295 15 comentarios 25 reacciones 0 asignados Ver en GitHub
area: material/datepicker P3
Lenguaje dominante
TypeScript
Estrellas
25k
Forks
6.8k
Merge medio
1 d 8 h
PR fusionados (30 d)
91

Descripción

#### Bug, feature request, or proposal:
Bug

#### What is the expected behavior?
I am not sure it is expected to behave like that or not, but I think that changing min value of datepicker shouldn't fire value changes event of the form group. I changed value of min date inside subscribe method because I want to have mindate dynamically updated. I checked two conditions one with the formgroup where it happens twice all the time and another condition using just formcontrol this issue happens only first time.
If I comment out the update of the mindate inside subscribe everything will be okay

#### What is the current behavior?
Form Group value change happens when changing Datepicker min value via two way binding, Min value update happens inside Subscribe method. This issue causes to fire valuechanges twice

#### What are the steps to reproduce?
Reproduction is StackBlitz using the formgroup
https://stackblitz.com/edit/datepicker-min-date-bug?file=app/datepicker-min-max-example.ts

#### What is the use-case or motivation for changing an existing behavior?
I think something is odd because different conditions behave differently ( for example as I stated above about formcontrol vs formgroup)

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular Material 5.0.0-rc3

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Ejecuta la reproducción de StackBlitz enlazada en el issue, empezando por app/datepicker-min-max-example.ts y sus casos de form-group y form-control. Compara las emisiones de value-change cuando el valor mínimo del datepicker se actualiza dentro de la suscripción; se considera terminado cuando el comportamiento es coherente y dejan de producirse las emisiones duplicadas no deseadas.

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
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.