Skip to content

When replacing form control which has async validator the status from statusChange stays PENDING #20424

@dzonatan

Description

@dzonatan

I'm submitting a...

[X] Bug report

Current behavior

When replacing form control with a new one which has asynchronous validator only PENDING status is broadcasted from statusChanges observable.

const myForm = new FormGroup({
  myControl: new FormControl('simple input');
});
    
myForm.statusChanges
  .subscribe(status => console.log(status));

myForm.setControl('myControl', new FormControl('another input', null, asyncValidator));

Console will only print PENDING. Nothing more.

Expected behavior

Final VALID or INVALID status should be broadcasted after async validator finishes his job.

Minimal reproduction of the problem with instructions

https://stackblitz.com/edit/angular-qmdbkx

Please tell us about your environment

Angular version: 7.0.1

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions