-
Notifications
You must be signed in to change notification settings - Fork 6.8k
bug(MatAutocomplete): Errors not displaying #28887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Workaround use mat-hint and manually control visibility:
|
I have found that you need to put the form control on both the input and the mat-chip-grid for mat-error to work properly |
I am experiencing the same bug. The mat-error requires a working formControl to ever be visible and explicitly linked to matInput. This is especially true if you have a custom component because what? You should always make a copy of formControl even with VALUE_ACCESSOR? |
Currently, when multiple mat form fields are used together, the error is taken for the first control only, this take into consideration other controls too if they exist Fixes angular#28887
…eld controls Currently, when multiple mat form fields are used together, the error is taken for the first control only, this take into consideration other controls too if they exist Fixes angular#28887
This is because the form control (chip grid in this case) isn't touched and invalid. Closing since it's working as expected. |
I solved this and this is "not a bug" but rather very poor documentation. |
@Cubelaster do you mind to drop an example of working example with mar-error? |
Is this a regression?
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:
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
The text was updated successfully, but these errors were encountered: