angular / angular/components

bug(mat-date-range-picker): When used with angular forms, `valueChanges` is fired multiple times.

Open
#19,776 15 comments 5 reactions 0 assignees View on GitHub
area: material/datepicker P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and compare valueChanges emissions from the formGroup, start, and end controls in the Angular 10 date-range-picker example. Trace the date range picker’s interaction with Angular forms, then verify that each change emits once at all three levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.