question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reactive form async validation is not working as expected

See original GitHub issue

🐞 bug report

Affected Package

The issue is caused by package @angular/forms@9.1.5

Is this a regression?

Don't know.

Description

Async validation of Reactive Forms from docs example passes if you type:
  • Eric (wait for validation),
  • Erica (wait for validation)
  • Eric and hit Submit. validation-pass It works ok in Template-driven form.

πŸ”¬ Minimal Reproduction

Just download example from https://angular.io/guide/form-validation and play with it.

🌍 Your Environment

Angular Version:




Angular CLI: 9.1.4
Node: 12.13.0
OS: win32 x64

Angular: 9.1.5
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router, upgrade
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.901.4
@angular-devkit/build-angular     0.901.4
@angular-devkit/build-optimizer   0.901.4
@angular-devkit/build-webpack     0.901.4
@angular-devkit/core              9.1.4
@angular-devkit/schematics        9.1.4
@angular/cli                      9.1.4
@ngtools/webpack                  9.1.4
@schematics/angular               9.1.4
@schematics/update                0.901.4
rxjs                              6.5.5
typescript                        3.8.3
webpack                           4.42.0

Anything else relevant?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
g-zwolinskicommented, May 27, 2020

@AndrewKushnir try click submit without leaving β€œAlter Ego” field. Then you can see that there was no validation before submit. Check attached gif asyncvalidationissue

0reactions
angular-automatic-lock-bot[bot]commented, Aug 13, 2020

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular Async Validator not working as expected
I am tying to implement custom async validator in angular. But it does not seem to be working. There are no errors in...
Read more >
Using Custom Async Validators in Angular Reactive Forms
Ocasionally, we want to validate some input in our fields before submission, which will be validated against an asynchronous source.
Read more >
Angular forms validation. Part III. Async Validators gotchas
As soon as validation is completed FormGroup status becomes VALID So everything goes smooth and absolutely as expected.
Read more >
Creating Angular Synchronous and Asynchronous Validators ...
Validators work primarily through what's returned from the validate() method. The validate(control:abstractControl): ValidationErrors|nullΒ ...
Read more >
AsyncValidator - Angular
An interface implemented by classes that perform asynchronous validation. ... null> // inherited from forms/Validator validate(control: AbstractControl<any,Β ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found