components
components copied to clipboard
bug(matFormField): Form field state not being updated properly when input dynamically changes
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
version 14
Description
When dynamically changing the input type of a form field, the label and error state of the for field is not properly reflected, the label will not float up and the form outline color will not be set. See demo example
Confirmed that id used to work properly in version 14 see demo working
Reproduction
Steps to reproduce:
- open demo
- toggle slider
- click submit
- see that label has not floated and form outline is not red
- open v14 demo and see it working properly stackblitz
Expected Behavior
Form field should allow inputs to dynamically change
Actual Behavior
Error state and label are not propely reflected
Environment
- Angular: 17
- CDK/Material: 17