angular / angular/components

feat(datepicker): use invalid date instead of null when the date input it not empty

Open
#27,902 2 comments 11 reactions 0 assignees View on GitHub
area: material/datepicker feature P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### Feature Description

Set the value to invalid date instead of null, when the input is filled, but invalid. As this would be a breaking change, maybe introduce a setting to optionally enable this.

### Use Case

Currently when you use a datepicker without ngModel or reactive forms the input wont get red for invalid inputs and the value is null. So you cant differenciate between empty input and something invalid. Even aria-invalid is "false".

With this feature you could solve this.

Contributor guide

Open the contributing guide

Research direction

Start by locating the datepicker implementation and its handling of filled but invalid input. Review how empty and invalid values currently differ, including aria-invalid behavior, and identify existing datepicker tests before deciding how an opt-in setting should work. Done means invalid non-empty input is distinguishable from empty input without changing default behavior unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.