-
Notifications
You must be signed in to change notification settings - Fork 25.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(forms) Async-Validators not triggered for ControlGroup as long as Sync-Errors persist #8118
Comments
This is by design and we've got a test to prove it: angular/modules/@angular/forms/test/form_control_spec.ts Lines 177 to 187 in e42a057
I guess that the reasoning is that async validation is "expensive" and as such should run after sync validators.
Why? If sync validators mark a filed as invalid there is no point in checking with async validators. It was already market as invalid. Do you have a specific use-case where the current design causes problems? |
Yep, this is by design. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Steps to reproduce and a minimal demo of the problem
Having a dependent validation in the form "If state is not "BACKLOG" assignee is required" using asyncValidators is not triggering as long as other Validations-Errors (e.g. required on another field) persist.
See the following plnkr:
http://plnkr.co/edit/8bmXDkmKiILUtKkRKhaf?p=preview
When your first action is to choose the state, the asncValidator will not be executed! Only after making the title field valid, by typing something in the title-field async-Validation works.
Current behavior
Async-Validations only get triggered, when no invalid sync-validations are present.
Expected/desired behavior
Async-Validations should be triggered independent of other validation errors.
Other information
The text was updated successfully, but these errors were encountered: