angular / angular/components

bug(mat-datepicker): calendar with startAt attribute will not update on manual input

未关闭
#28,814 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
area: material/datepicker P4
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

### 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 built a mat-datepicker with startAt property (e.g. 01/01/2024).
Calendar starts as described in documentation at demanded calendar page.
If input value is changed, calendar will not update to desired page. (e.g. date is changed to 05/05/2024, calendar page is still on January 2024 instead of May 2024)

### Reproduction

StackBlitz link: https://stackblitz.com/edit/datepicker-property-error
Steps to reproduce:
1. Change input to any other date (e.g. 5/5/2024) either by typing or selection on calendar.
2. (Re-)Open calendar.

### Expected Behavior

Calendar should switch to page of desired month (e.g. May 2024).
startAt property should only set initial date and react accordingly to changes.

### Actual Behavior

Calendar does not change its page according to the input date. It remains on startAt date.

### Environment

- Angular: v17
- CDK/Material: 17.3.1
- Browser(s): Chrome, Firefox
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

贡献指南

打开贡献指南

调研方向

首先在链接的 StackBlitz 中复现该行为,并检查 mat-datepicker 入口点,了解 startAt 和手动输入如何影响显示的月份。验证输入或选择新日期,然后确认重新打开日历时会显示输入日期所在的月份,而 startAt 只控制初始页面。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。