Bug: Datepicker value change event fires when changing min value of it
- Lingua principale
- TypeScript
- Stelle
- 25k
- Fork
- 6.8k
- Merge medio
- 1g 8h
- PR unite (30g)
- 91
Descrizione
#### 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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Esegui la riproduzione StackBlitz collegata nell’issue, iniziando da app/datepicker-min-max-example.ts e dai relativi casi form-group e form-control. Confronta le emissioni di value-change quando il valore min del datepicker viene aggiornato all’interno della sottoscrizione; il lavoro è completato quando il comportamento è coerente e le emissioni duplicate indesiderate non si verificano più.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100