bug(mat-form-field): mat-error not displayed when form field is in an error state. #19960
Labels
area: material/form-field
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Reproduction
The Stackllitz app (https://stackblitz.com/edit/yz1dhz-m5re6l) renders two form controls in a form group:
Both form controls are immediately invalid because they are initailized with null and have a required validator. The error message for each form control is displayed in
<mat-error>
.Steps to reproduce:
<mat-select>
form control to set the corresponding validator on the second form control (the custom form field).{ "required": true, "message": "Must be Foo" }
.<mat-hint>
is shown. All good so far :)<mat-error>
is NOT displayed and the<mat-hint>
is.Expected Behavior
<mat-hint>
is hidden and<mat-error>
is displays{ "message": "Must be Bar" }
Actual Behavior
<mat-error>
is hidden and<mat-hint>
is displaysI am a hint.
Environment
The text was updated successfully, but these errors were encountered: