Skip to content

bug(Timepicker): timepicker control error state too early #30223

Closed
@RafalSzczuka

Description

@RafalSzczuka

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

Timepicker dropdown marks touched state differently than regular select dropdown or datepicker select. It displays an error state too early - just after dropdown time option click. It marks control as invalid for just a blink of a second and then it's valid again. It's unexpected behavior.
Also - when I subscribe to statusChanges stream - timepicker control starts with initial value. It's not how other form controls behave - other controls emits status change.
I'm using the default ErrorStateMatcher and Validators.required validator.

Reproduction

StackBlitz link: https://stackblitz.com/edit/6sygygc8-fabhxjua
Steps to reproduce:

  1. Click on timepicker input
  2. Click (and hold) any option
  3. See that input is marked as invalid (error border)
  4. Release mouse click - error goes away

Expected Behavior

It should mark input error state the same way as it works for other material form controls

Actual Behavior

It's marking an error state too early, even if a valid option is selected.

Environment

  • Angular: 19.0.0
  • CDK/Material: 19.0.0
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/timepicker

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions