angular / angular/components

bug(datepicker): monthSelected doesn't actually update formControl if calendar view closed before picking a date in the month

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

Description

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

When opening a 'monthView' and closing a calendar in monthSelected event, pre-setting formControl value, its actually not changed. Its visible from the example I attached

### Reproduction

StackBlitz link: https://stackblitz.com/edit/c5ckw68f?file=src%2Fexample%2Fdatepicker-views-selection-example.html,src%2Fexample%2Fdatepicker-views-selection-example.ts,src%2Fexample%2Fdatepicker-views-selection-example.css
Steps to reproduce:
1. Select a different month in the calendar
2. Check the output values

### Expected Behavior

formControl value has a selected month

### Actual Behavior

formControl value doesn't change

### Environment

- Angular: 19.1.3
- CDK/Material: 19.1.3
- Browser(s): Chrome (all basically)
- Operating System: Windows

Contributor guide

Open the contributing guide

Research direction

Start with the StackBlitz reproduction, especially src/example/datepicker-views-selection-example.html and src/example/datepicker-views-selection-example.ts, and reproduce the monthView flow by closing the calendar from the monthSelected event. Trace the datepicker form-control update path and verify that selecting a month leaves the formControl with the selected month after the calendar closes.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.