angular / angular/components

bug(material/datepicker): There is no way to deselect the selected date(s) while a calendar is open

Đang mở
#29,877 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area: material/datepicker P2
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

I have a reset button in the date range picker, but when I try to reset the selected dates using the reset button, it resets the models but not the selection in the date range picker widget.

![Image](https://github.com/user-attachments/assets/597ce098-3598-4d91-87a5-712627d075b0)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/4wfp1v-mbnz3s?file=src%2Fexample%2Fdate-range-picker-overview-example.html

Steps to reproduce:
1. Open the date range picker widget.
2. Select a date range.
3. Click the reset button.
4. Observe that while the underlying models are reset, the date selection in the date range picker widget remains unchanged.

### Expected Behavior

I was expecting the date range picker widget to completely clear the selected dates and reset to its default state when the reset button is clicked, along with resetting the underlying models.

### Actual Behavior

The actual behavior is that when the reset button is clicked, the underlying models are reset, but the selected dates in the date range picker widget remain highlighted and do not clear.

### Environment

- Angular: ^19.0.0-next.2
- CDK/Material: ^19.0.0-next.2
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows and Ubuntu

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 StackBlitz được liên kết, cụ thể là src/example/date-range-picker-overview-example.html, và tái hiện luồng reset trong date-range picker. Theo dõi hành vi của widget sau khi các model được xóa và xác định các bài kiểm thử Material date-range picker liên quan; hoàn thành khi nút reset xóa cả các model lẫn lựa chọn ngày được đánh dấu.

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
42/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.