Skip to content

bug(matStartDate,matEndDate): matStartDate & matEndDate in mat-date-range-input are touched and dirty from the beginning #20213

@ilianiv

Description

@ilianiv

Reproduction

StackBlitz: https://stackblitz.com/edit/angular-qpcqzz?embed=1&file=src/app/date-range-picker-forms-example.html

Steps to reproduce:

  1. Bind [(ngModel)] to matStartDate & matEndDate in mat-date-range-input
  2. Inspect ng-touched, ng-dirty and ng-pristine css classes of matStartDate & matEndDate inputs

Expected Behavior

Controls behind matStartDate & matEndDate must be pristine: true, dirty: false, touched: false at the beginning if
no one interacted with them

Actual Behavior

They are dirty, touched and not pristine

Environment

  • Angular: 10.0.7
  • CDK/Material: 10.1.2
  • Browser(s): Any
  • Operating System (e.g. Windows, macOS, Ubuntu): Any

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaroundarea: material/datepicker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions