angular / angular/components

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

Offen
#9,295 15 Kommentare 25 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area: material/datepicker P3
Vorherrschende Sprache
TypeScript
Sterne
25k
Forks
6.8k
Ø Merge
1 T. 8 Std.
Gemergte PRs (30 T.)
91

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Führe die im Issue verlinkte StackBlitz-Reproduktion aus, beginnend mit app/datepicker-min-max-example.ts und den Fällen für form-group und form-control. Vergleiche die value-change-Emissionen, wenn der min-Wert des Datepickers innerhalb des Abonnements aktualisiert wird; erledigt ist die Aufgabe, wenn das Verhalten konsistent ist und die unbeabsichtigten doppelten Emissionen nicht mehr auftreten.

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
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

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