components icon indicating copy to clipboard operation
components copied to clipboard

bug(MatAutocomplete): Errors not displaying

Open patrickkforrit opened this issue 1 year ago • 1 comments

Is this a regression?

  • [X] Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

14.3.0

Description

Having a Error to show alongside a mat-autocomplete and mat-chip-grid the error is never shown.

Reproduction

StackBlitz link: https://stackblitz.com/edit/uvatjk?file=src%2Fapp%2Fchips-autocomplete-example.ts,src%2Fapp%2Fchips-autocomplete-example.html Steps to reproduce:

  1. Touch the control
  2. Enter a value
  3. Remove the value

Expected Behavior

Expected the mat-form-field to have an error state and the mat-error to show up

Actual Behavior

No feedback on any error and the tag is not shown in the dom

Environment

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

patrickkforrit avatar Apr 16 '24 11:04 patrickkforrit

Workaround use mat-hint and manually control visibility:

<mat-hint class="mat-mdc-form-field-error" *ngIf="conditionToShow">Error</mat-hint>

patrickkforrit avatar Apr 16 '24 11:04 patrickkforrit