components
components copied to clipboard
bug(MatAutocomplete): Errors not displaying
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
Reproduction
StackBlitz link: https://stackblitz.com/edit/uvatjk?file=src%2Fapp%2Fchips-autocomplete-example.ts,src%2Fapp%2Fchips-autocomplete-example.html Steps to reproduce:
- Touch the control
- Enter a value
- 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
Workaround use mat-hint and manually control visibility:
<mat-hint class="mat-mdc-form-field-error" *ngIf="conditionToShow">Error</mat-hint>