bug(mat-date-picker): month shown twice in date picker
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 72/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- angular, typescript
- 领域
- frontend
调研方向
先在 Basic datepicker example 中复现该问题,然后阅读 src/material/datepicker/calendar.ts 中日历标题和报告所引用的月份视图标签附近的代码。确认重复的月份出现在 day-picker mode 中,并验证下方的月份标签不存在,而 month-year control 仍然可见。
由索引模型根据 Issue 内容生成。
描述
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
The month appears twice in the date picker, once in the month-year element at the top
#mat-datepicker-0 > mat-calendar-header > div > div > button.mdc-button.mat-mdc-button-base.mat-calendar-period-button.mat-mdc-button.mat-unthemed > span.mdc-button__label > span
SEP 2026
and then again in the body of the calendar below the days of week headers
#mat-datepicker-0 > div > mat-month-view > table > tbody > tr:nth-child(1) > td.mat-calendar-body-label
SEP
Some of this code is from:
https://github.com/angular/components/blob/a69732f546a5f1f43faeb0039fa08e4f7a1150f0/src/material/datepicker/calendar.ts#L162-L164
The other side is really old:
https://github.com/angular/components/blob/3b31d7b88998d3c26530436e72e1b57283e1cbde/src/lib/datepicker/calendar.ts#L91-L93
Reproduction
Steps to reproduce:
- Visit https://material.angular.dev/components/datepicker/overview
- Click the 📆 button next to
Choose a datein theBasic datepickerbox - See the current month and current year at the top left
- See the current month again two lines below
Expected Behavior
Don't show the current month again below the days of the week when in day picker mode and the month is shown at the top.
Actual Behavior
The month is shown twice.
Environment
- Angular: 21.2.9
- CDK/Material: 21.2.9
- Browser(s): chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 81
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/components 的其他 Issue
-
area: docs docs gemini-triaged P3
难度 1/5 1 小时以内 新手友好度 78/100
angular/components#33836 · 1 条评论 · 已指派 1 人 ·
-
area: material/tree docs gemini-triaged needs triage
难度 2/5 1-3 小时 新手友好度 68/100
angular/components#33832 ·
-
area: material/table gemini-triaged P4
难度 1/5 1 小时以内 新手友好度 88/100
angular/components#33709 · 1 条评论 ·
-
area: material/table docs gemini-triaged P4
难度 2/5 1-3 小时 新手友好度 72/100
angular/components#33455 ·
-
area: material/core gemini-triaged P3
难度 1/5 1 小时以内 新手友好度 78/100
angular/components#33059 · 2 条评论 ·
查看 angular/components 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
copse-dev/agent-pane#2953 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
难度 2/5 1-3 小时 新手友好度 78/100
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
-
calcite-components needs triage refactor
难度 2/5 1-3 小时 新手友好度 75/100
Esri/calcite-design-system#15203 ·