What is making the password autofill bar show above the keyboard in Android Chrome?

1.8k Views Asked by At

About a week ago I noticed that Android Chrome was showing a password autofill bar above the keyboard in my app (Parchment). The HTML for the <input> is the following, which is definitely not a password input:

<input aria-hidden="false" autocapitalize="off" class="Input LineInput" type="text" maxlength="120">

Does anyone know what would make Chrome think that the password autofill bar should be displayed, and what can be done to stop it happening?

Screenshot from Parchment in Android Chrome showing the password autofill bar

2

There are 2 best solutions below

0
On

If the input is inside of the form, put and attr on the form that is autocomplete="off", then make a hidden input as the first child of that form, with also autocomplete="off" If it doesn't work, then try doing autocomplete="chrome-off"

0
On

This problem exists for a whole range of input types. I tested and confirmed it's an issue for type="text", type="number", type="password", type="tel", type="url", type="email"

The only type not affected is type="search"

Depending on your application, it may or may not be possible to switch to a search input. For me, it made sense as it was a search of sorts.

I've given a more detailed response on this related SO question