Skip to content

Reactive form async validation is not working as expected #36997

Closed

Description

@popec

🐞 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?

Activity

  1. added this to the needsTriage milestone on May 8, 2020
  2. AndrewKushnir commented on May 19, 2020

    @AndrewKushnir
    Contributor

    Hi @popec, thanks for reporting the issue. Could you please also provide a minimal repro using Stackblitz, so we can better understand your report? Thank you.

  3. added
    needs reproductionThis issue needs a reproduction in order for the team to investigate further
    on May 19, 2020
  4. popec commented on May 21, 2020

    @popec
    Author
  5. AndrewKushnir commented on May 26, 2020

    @AndrewKushnir
    Contributor

    Hi @popec, thanks for creating a repro. I tried to follow your instructions, but was unable to submit the form in "invalid" state. Could you please let me know if there are some additional steps I need to take to reproduce the issue? Thank you.

  6. g-zwolinski commented on May 27, 2020

    @g-zwolinski

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

  7. AndrewKushnir commented on May 30, 2020

    @AndrewKushnir
    Contributor

    Thanks for additional information. It looks like this is a bug, seems related/duplicate of #10064 (there is an open PR #22575 to resolve that). I will keep this ticket open since it contains up-to-date repro. Thank you.

  8. AndrewKushnir commented on Jul 13, 2020

    @AndrewKushnir
    Contributor

    Hi, the changes in PR #10064 were merged and will be available in Angular v10.1.0 (which should be available on NPM in a few weeks). I'm closing this ticket for now. Feel free to reopen if the problem still exists after upgrading the v10.1.0 once it's released. Thank you.

  9. angular-automatic-lock-bot commented on Aug 13, 2020

    @angular-automatic-lock-bot

    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.

  10. locked and limited conversation to collaborators on Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions