angular / angular/components

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

Đang mở
#30,463 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
area: material/datepicker P4
Ngôn ngữ chính
TypeScript
Star
25k
Fork
6.8k
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
91

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với bản tái hiện trên StackBlitz, đặc biệt là src/example/datepicker-views-selection-example.html và src/example/datepicker-views-selection-example.ts, rồi tái hiện luồng monthView bằng cách đóng lịch từ sự kiện monthSelected. Theo dõi đường dẫn cập nhật form-control của datepicker và xác minh rằng việc chọn một tháng vẫn để formControl chứa tháng đã chọn sau khi lịch đóng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, typescript
Lĩnh vực
frontend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.