-
Notifications
You must be signed in to change notification settings - Fork 8
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
656 autofill bug #1609
656 autofill bug #1609
Conversation
7c0432c
to
b879be6
Compare
The incorrect element was being passed to the autofill monitor. ISSUES CLOSED: #656
b879be6
to
4dcd007
Compare
Codecov Report
@@ Coverage Diff @@
## release #1609 +/- ##
===========================================
+ Coverage 98.81% 98.83% +0.02%
===========================================
Files 126 126
Lines 4798 4797 -1
Branches 832 833 +1
===========================================
Hits 4741 4741
Misses 56 56
+ Partials 1 0 -1
Continue to review full report at Codecov.
|
@@ -15,6 +15,7 @@ | |||
[isRequired]="true" | |||
[spellcheck]="false" | |||
[autocapitalize]="false" | |||
autocomplete="email" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what difference does it make with or without this autocomplete
input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The autocomplete
attribute tells the browser what data should be used when providing autocompletion.
In my quick tests it seems that both Chrome and FF can infer this if the input has a name or type that defines email
. But since this is the 'correct' way to define it, I thought it should be added.
this.autofillMonitor.monitor(this.elementRef.nativeElement).subscribe(event => { | ||
public ngAfterViewInit(): void { | ||
// Begin monitoring for the input autofill | ||
this.autofillMonitor.monitor(this.inputElement.nativeElement).subscribe(event => { | ||
this.autofilled = event.isAutofilled; | ||
this.stateChanges.next(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the meat of this fix...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Mainly we were passing a reference to our component rather than the actual <input>
element. Moving the setup into ngAfterViewInit
just makes sure all the ngIf
s are settled before using that reference.
Fixes #656