forms: update required validator when input is autofilled
- Dominant language
- TypeScript
- Stars
- 101k
- Forks
- 27.5k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 288
Description
# 🚀 feature request
### Relevant Package
This feature request is for @angular/forms
### Description
The `RequiredValidator` does not update its validation status when an input is autofilled in Chrome. This is problematic for users who set up a required username and password input and then conditionally enable the submit button when the inputs are valid. The user sees:
1. Page loads
2. Inputs are autofilled with username and password
3. Submit button is still disabled.
This issue has been filed in the past on the components repo: https://github.com/angular/components/issues/3414, though the change would really have to happen in @angular/forms.
### Describe the solution you'd like
@angular/cdk has an `AutofillMonitor` that could be moved to @angular/forms and used to detect when an input is autofilled.
### Describe alternatives you've considered
It is possible to monkey patch a solution, as @kherock [demonstrated](https://stackblitz.com/edit/autofillmon-validate?file=app/autofillvalueaccessor.directive.ts) on the components issue.
Contributor guide
Assessment
This issue has not been assessed yet.