Skip to content

bug(MatFormField): Reactive Forms with FormGroup inside child component doesn't highlight when invalid #20341

Open
@eholman

Description

Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/angular-material-formgroup-nested

Steps to reproduce:

  1. Connect a form group to a child component (with custom input component) with validations configured
  2. Submit the form without value and the form is invalid

Expected Behavior

All the input fields that are invalid to get highlighted.

Actual Behavior

Components that are on the root group are highlighted

Environment

  • Angular: 10+
  • CDK/Material:10.0.2 - 10.1.3
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows

Metadata

Assignees

No one assigned

    Labels

    P2The issue is important to a large percentage of users, with a workaroundarea: material/form-fieldarea: material/inputformsThis 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