X Tutup
Skip to content

Invalid state of a control in a control group hierarchy is not detected by the root control group #4994

@Krustie101

Description

@Krustie101

Consider the following code:

var fb:FormBuilder (injected)

var groupC : ControlGroup = fb.group({
   groupB: fb.group({
        controlA : ["",Validators.required]
   })
})

var controlA : Control = <Control> groupB.find('groupB/controlA');

console.log("Control A valid:" + controlA.valid);
console.log("Group B valid:" + groupB.valid);
console.log("Group C valid:" + groupC.valid);

controlA.updateValue("");

console.log("Control A valid:" + controlA.valid);
console.log("Group B valid:" + groupB.valid);
console.log("Group C valid:" + groupC.valid);

In both cases controlA and groupB are invalid (to be expected) but groupC is valid (unexpected).

See the first bullet point in #4917 (comment) for what I think the bug is.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup