I'm working on a login form, with two fields: email
and password
, using the ionic2 framework.
<ion-item>
<ion-label floating>Email</ion-label>
<ion-input formControlName="email" type="text" #emailModel></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input formControlName="password" [type]="isActive ? 'text' : 'password'"></ion-input> </ion-item>
<ion-grid padding>
After a few tests I've noticed that when I type an email already typed before no autofill pops under the input as it normally does for a normal input
. Is this normal behaviour for a login form?
By using [(ngModel)]="value" you bind the value variable to that input field. That way it is always updated. If you change it in the UI, it is immediately updated "in the code". And when you update it in your code, it automatically updates in the UI.
The fix that I've figured was this:autocomplete="on"
and name="email"
<ion-input autocomplete="on" name="email" formControlName="email" type="text" #emailModel></ion-input>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With