angular / angular/components

bug(mat-date-picker): month shown twice in date picker

オープン 初心者向け
#33,763 コメント 0 件 リアクション 2 件 担当者 0 名 GitHub で見る
area: material/datepicker gemini-triaged P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
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

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:
1. Visit https://material.angular.dev/components/datepicker/overview
2. Click the 📆 button next to `Choose a date` in the `Basic datepicker` box
3. See the current month and current year at the top left
4. 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.

Image

### Environment

- Angular: 21.2.9
- CDK/Material: 21.2.9
- Browser(s): chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず Basic datepicker example で問題を再現し、次に src/material/datepicker/calendar.ts のカレンダーヘッダーと、報告で参照されている月ビューのラベルの周辺を読みます。day-picker mode で重複した月が表示されることを確認し、month-year control が表示されたままである一方、下側の月ラベルがないことを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
72/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。