Skip to content

Formgroup of subform does not propagate errors to root form #297

@andreashouben

Description

@andreashouben

Hi there,

we have a subform that contains a FormGroup. In that FormGroup I have a required input field. When I touch it The input field get's red, but the root form does not receive the error.

This is our form declaration:

form = createForm<DeepLinkForm>(this, {
    formType: FormType.SUB,
    formControls: {
      deeplinkIdentifier: new FormControl(),
      deeplinkAction: new FormGroup({
        actionIdentifier: new FormControl(),
        action: new FormControl('', Validators.required),
      }),
      freeTexts: new FormArray<FormControl<FreeText>>([]),
      enabled: new FormControl(),
      description: new FormControl(),
      information: new FormControl(),
    },
  });

Notice: The deeplinkAction.action is required.

When I analyze the form with the angular debugger I notice that I get an error in the control:

image

But the parent formGroupErrors stay null:
image

I think because of that the root form doesn't get updated. Do you have an idea on what might be the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Help wantedHelp wanted from the community

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions