Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic 2 ion-input no browser autofill?

Tags:

input

ionic2

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?

like image 344
sTx Avatar asked May 03 '17 11:05

sTx


People also ask

How do you set the value of ion-input?

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.


1 Answers

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>
like image 188
sTx Avatar answered Sep 27 '22 22:09

sTx