Skip to content
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

[Ionic v4-beta.3] ion-input: autofill / autocomplete not working. #15208

Closed
tja4472 opened this issue Aug 16, 2018 · 6 comments
Closed

[Ionic v4-beta.3] ion-input: autofill / autocomplete not working. #15208

tja4472 opened this issue Aug 16, 2018 · 6 comments
Labels
package: core @ionic/core package

Comments

@tja4472
Copy link
Contributor

tja4472 commented Aug 16, 2018

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.1.0 (C:\Users\Tim\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.3
   @angular-devkit/core       : 0.7.3
   @angular-devkit/schematics : 0.7.3
   @angular/cli               : 6.1.3
   @ionic/ng-toolkit          : 1.0.6
   @ionic/schematics-angular  : 1.0.5

System:

   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.0
   OS     : Windows 10

Describe the Bug
autofill/autocomplete not working with ion-input.

Steps to Reproduce

<ion-content padding>
  <input type="text" autocomplete="name"/>
  <form [formGroup]="userForm">
    <ion-list>
      <ion-item>
        <ion-label position="floating">Name</ion-label>
        <ion-input formControlName="name"
                   autofocus
                   autocomplete="name"
                   type="text"></ion-input>
      </ion-item>

Related Code

Expected Behavior
autofill/autocomplete to work as html input.

Additional Context

@ionitron-bot ionitron-bot bot added the triage label Aug 16, 2018
@Nightbr
Copy link

Nightbr commented Nov 9, 2018

Same here, after further investigation seems to be browsers which not handle input in Shadow DOM. Look at this issue: WICG/webcomponents#572

Finally they decided to include Shadow root to look for autocomplete attr look at this: whatwg/html#2149

So we have to options here:

  • Wait a patch in browser to look in Shadow root to find our autocomplete input to autofill them
  • Find a workaround and dev it (I'm looking a workaround if someone has an idea to manipulate the browser autofill API)

Cheers

@paulstelzer paulstelzer added type: feature request a new feature, enhancement, or improvement and removed triage labels Dec 3, 2018
@paulstelzer
Copy link
Contributor

Could you check if this issue is resolved with beta.19? We are now using a input without Shadow dom, so maybe this will work now :)

@paulstelzer paulstelzer added needs: reply the issue needs a response from the user and removed type: feature request a new feature, enhancement, or improvement labels Dec 16, 2018
@tja4472
Copy link
Contributor Author

tja4472 commented Dec 18, 2018

Works with text ion-input.

With username/password the password field is not picked up.

<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-menu-button></ion-menu-button>
    </ion-buttons>
    <ion-title> Home </ion-title>
  </ion-toolbar>
</ion-header>

<ion-content>
  <form method="post">
    <!--
      HTML input:<input type="text" name="fname" autocomplete="on" /><br />
      HTML input username:<input type="text" name="username" autocomplete="on" /><br />
      HTML input password:<input type="password" name="password" autocomplete="on" /><br />
    -->

    <ion-item>
      <ion-label position="floating">ion-input</ion-label>
      <ion-input name="fname" autocomplete="on" type="text"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label position="floating">ion-input username</ion-label>
      <ion-input name="username" autocomplete="on" type="text"></ion-input>
    </ion-item>

    <ion-item>
      <ion-label position="floating">ion-input password</ion-label>
      <ion-input name="password" autocomplete="on" type="password"></ion-input>
    </ion-item>

    <input type="submit" />
    <!-- <ion-button type="submit" expand="block">Sign In</ion-button> -->
  </form>
</ion-content>
Ionic:

   ionic (Ionic CLI)             : 4.5.0 (C:\Users\Tim\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.19
   @angular-devkit/build-angular : 0.11.3
   @angular-devkit/schematics    : 7.1.3
   @angular/cli                  : 7.1.3
   @ionic/angular-toolkit        : 1.2.0

System:

   NodeJS : v10.14.2 (C:\Program Files\nodejs\node.exe)
   npm    : 6.5.0
   OS     : Windows 10

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Dec 18, 2018
@tja4472
Copy link
Contributor Author

tja4472 commented Dec 19, 2018

@paulstelzer
Copy link
Contributor

I close this for now because it should fixed with #17043 . After rc.2 release you can check again and if it still not working, just create a comment here and I reopen.

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 12, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package
Projects
None yet
Development

No branches or pull requests

3 participants