Skip to content

bug(form-field): Updating input value via effect+FormControl doesn't trigger label position calculation #32228

@benelliott

Description

@benelliott

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

When updating a FormControl value inside a signal effect, the MatFormField floating label does not reposition under OnPush change detection unless ChangeDetectorRef.markForCheck() is called manually.

Reproduction

StackBlitz link: https://stackblitz.com/edit/ujogbvgu?file=src%2Fexample%2Fform-field-overview-example.ts
Steps to reproduce:

  1. Update input via FormControl + effect
  2. Observe that label position does not update unless ChangeDetectorRef.markForCheck() is invoked explicitly.

Expected Behavior

Using signals and effects, I expected not to have to call ChangeDetectorRef.markForCheck() for the label to float.

Actual Behavior

The label did not float when the control's value was set.

Environment

  • Angular: 20.2.x
  • CDK/Material: 20.2.x
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/form-fieldformsThis issue is related to Angular Forms integration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions