bug(mat-date-range-picker): When used with angular forms, `valueChanges` is fired multiple times.
See original GitHub issueExpected Behavior
Observable should emit only once per change
Actual Behavior
When listening on the formGroup, it fires 4 times, and when listening on start or end it fires 2 times
Bug demo
https://stackblitz.com/edit/angular-date-range-bug
Environment
- Angular: 10
- CDK/Material: 10
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Reactive forms valueChanges method fires twice for one ...
If you want to take only first response and keep listening for changes on the Reactive Form with distinctUntilChanged(), you can use ......
Read more >FormArray - Angular
This method performs strict checks, and throws an error if you try to set the value of a control that doesn't exist or...
Read more >How to do Conditional Validation on valueChanges method in ...
In this blog post, we will learn to use Angular Reactive Forms value change detection and enable conditional validation on basis of that....
Read more >Angular - Angular inDepth
When using Reactive Forms the default way of disabling a FormControl is by using the ... Well, if we click several times on...
Read more >Datepicker - Angular Material
If you want your users to select a range of dates, instead of a single date, you can use the mat-date-range-input and mat-date-range-picker...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

a less ugly workaround:
Same issue still with ng14 https://github.com/angular/components/issues/20218#issuecomment-1262584283