Home > Software design >  Angular not auto completing email?
Angular not auto completing email?

Time:11-12

Hello I have an input field for email like this:

 <input  #emailInput autocomplete="new-email" type="text" formControlName="email"
        (blur)="trimSpace()" (keypress)="disallowSpace($event)"
        name="email">

however i am not getting autocompletion like from usually HTML5 functionality?

CodePudding user response:

This is because you have a typo in autocomplete attribute.

autocomplete="new-email"

It should be autocomplete="email" instead.

P.S. new-password is valid option, not new-email.

Link

CodePudding user response:

autocomplete attribute doesn't have new-email value. You should use just email instead. So your code will look like this:

 <input  #emailInput autocomplete="email" type="text" formControlName="email"
        (blur)="trimSpace()" (keypress)="disallowSpace($event)"
        name="email">
  • Related