Skip to content

Mat-hint causing an ExpressionChangedAfterItHasBeenCheckedError if respective input has a *ngIf directive #16209

Closed
@jspieker

Description

@jspieker

Reproduction

Minimal repro on StackBlitz. Open the console to see the following error message:

Error: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'aria-describedby: null'. Current value: 'aria-describedby: mat-hint-0'.

This always happens if the respective input has a *ngIf-directive. I couldn't observe any subsequent errors caused by this. Using the hintLabel property instead of a <mat-hint> results in the same error.

Expected Behavior

No ExpressionChangedAfterItHasBeenCheckedError when using *ngIf on an input

Actual Behavior

ExpressionChangedAfterItHasBeenCheckedError

Environment

  • Angular: ^7.1.4
  • CDK/Material: ^7.2.0
  • Browser(s): Chrome (Most recent @ Version 75.0.3770.80)
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions