Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Form statusChanges with async validators doesn't leave PENDING state and no StatusChangeEvent for VALID/INVALID state #61363

Copy link
Copy link
Closed
@vassilz

Description

@vassilz
Issue body actions

Which @angular/* package(s) are the source of the bug?

forms

Is this a regression?

No

Description

Hello,
i am aware of at least these two related issues:
#41519, #13200, but was not able to reopen either of them, so - sorry for the duplicate report.

I have a reactive form defined with a single text field. It has both a required validator, and a simple asynchronous validator. The field is initialized in the class constructor by calling form.patchValue() - see the reproduction link. As a result, the form enters PENDING state, a statusChanges value is emitted, and also a StatusChangeEvent. However, as soon as the asynchronous validator completes, there is no statusChanges value emitted, neither a StatusChangeEvent.

What was expected:
having a look at #41519 (comment), i think it is probably not expected that a VALID statusChanges value is emitted. However, it is expected that a StatusChangeEvent is emitted.

What happened:
Neither a VALID statusChanges value was emitted, nor a VALID StatusChangeEvent.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/stackblitz-starters-t7ffjddq?file=src%2Fmain.ts

Please provide the exception or error you saw

as mentioned above - there is no error occurring, but the behavior is different than expected

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.1.5
Node: 20.17.0
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 19.1.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1901.5
@angular-devkit/build-angular   19.1.5
@angular-devkit/core            19.1.5
@angular-devkit/schematics      19.1.5
@angular/cli                    19.1.5
@schematics/angular             19.1.5
rxjs                            7.8.1
typescript                      5.7.3
zone.js                         0.15.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.