angular / angular/components

bug(MatDateRangeInput): validation fails to update if end date gets set to after start date

オープン
#24,075 コメント 5 件 リアクション 2 件 担当者 0 名 GitHub で見る
area: material/datepicker P3
主要言語
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

When manually entering the start date to a date after the end date, you get a validation error "Invalid start date" which is correct and expected. However, if you correct the end date to a date that is after the start date the validation doesn't seem to update and still shows "Invalid start date".

### Reproduction

~~https://stackblitz.com/run?file=src/app/date-range-picker-forms-example.ts~~
https://stackblitz.com/edit/angular-ivy-a3ezpw?file=src/app/app.component.html

Steps to reproduce:
1. Set start date to 12/1/2021 and end date to 12/2/2021
2. Set start date to 12/3/2021
3. Set end date to 12/4/2021

### Expected Behavior

As soon as the end date is set to after the start date, validation should update and hide the error.

### Actual Behavior

"invalid start date" error is still shown.

### Environment

- Angular: ^12.2.9
- CDK/Material: ^12.2.9
- TypeScript: ^3.7.5
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): macOS

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

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

調査の方向性

リンクされている StackBlitz の再現例から始め、記載された手順に従って MatDateRangeInput のバリデーションを調査します。終了日を修正すると既存の "Invalid start date" エラーがクリアされることを確認し、その後、再現例での動作を検証します。

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

評価

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

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

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