NG_ASYNC_VALIDATORS on disabled control
See original GitHub issueI’m submitting a … (check one with “x”)
[x ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior NG_ASYNC_VALIDATORS not called if control is disabled
Expected/desired behavior NG_ASYNC_VALIDATORS called even if control is disabled.
- Angular version: 2.0.0-rc.6
- Browser: all
- Language: TypeScript 2.0
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Async Validators should not be fired on disabled control #42684
The Async Validation of a FormControl fires when the control is disabled. My understanding, i.e. from #11287 is that this behavior should not...
Read more >Using Custom Async Validators in Angular Reactive Forms
In Angular, you can do this using Async Validators. ... DISABLED: This control is exempt from validation checks. async validator 3/3.
Read more >Control with async validator changes its state to pending when ...
This will cancel any currently running async validators, leaving the control in PENDING status. Next, the call to this._runAsyncValidator(opts.
Read more >Angular: Custom Async Validators - Medium
Angular: Custom Async Validators. Angular has a very robust library for handling ... DISABLED: This control is exempt from validation checks.
Read more >AbstractControl - Angular
A control is disabled when its status is DISABLED . Disabled controls are exempt from validation checks and are not included in the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Disabled controls are exempt from validation by design to match how native HTML5 forms work. So it’s expected that async validators wouldn’t run in that case. The bug here is that sync validators are still running. Though it won’t currently affect the calculation of the status, it’s unnecessary and we shouldn’t be calling them at all. I’m working on a PR to ensure sync validators won’t run on disabled controls either.
Hmm, not sure I see why this should be the case. If a control gets disabled a user can’t change its value so in this case validation of the user input doesn’t make much sense, no?
I’m sure I’m missing sth here so if you could elaborate / provide a plunker it would help clarifying.