components icon indicating copy to clipboard operation
components copied to clipboard

bug(matFormField): Form field state not being updated properly when input dynamically changes

Open meblum opened this issue 5 months ago • 0 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

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:

  1. open demo
  2. toggle slider
  3. click submit
  4. see that label has not floated and form outline is not red
  5. 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

meblum avatar Jan 29 '24 17:01 meblum