-
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
Asynchronous validator overrides validation result from synchronous validator #8923
Comments
Sounds similar to #8118 |
Just ran into this myself. The workaround I'm using for the time being is to wrap the synchronous validators in a promise and pass them all together as async validators using composeAsync. For example (I'm using TypeScript):
|
Yup, definitively a bug and one still present in RC6: https://plnkr.co/edit/y10r0ETIKShfVCqX91LP?p=preview |
…has changed Fixes angular#12709 Fixes angular#9120 Fixes angular#10074 Fixes angular#8923
…has changed Fixes angular#12709 Fixes angular#9120 Fixes angular#10074 Fixes angular#8923
…has changed (angular#13222) Fixes angular#12709 Fixes angular#9120 Fixes angular#10074 Fixes angular#8923 PR Close angular#13222
…has changed (angular#13222) Fixes angular#12709 Fixes angular#9120 Fixes angular#10074 Fixes angular#8923 PR Close angular#13222
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. |
Current behavior
When adding both synchronous and asynchronous validators to a control, the control is in valid state after the asynchrous validator is done even though the synchronous validator says invalid. For example if you have the "required" validator and a custom asynchrouns validator that takes 2 seconds to complete and you erase all text during these 2 seconds the control is in valid state after the 2 seconds.
Expected/desired behavior
The control should be in invalid state because of the "required" validator.
The control should be in invalid state and not valid state because of the "required" validator
Form validation should work with asynchronous validators
The text was updated successfully, but these errors were encountered: