Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome is autofilling my select2 input with its placeholder

I'm currently experiencing a very annoying problem with Google Chrome. I have some filters that are a multi-select and when I click to type on those filters, chrome suggests as an autofill option the placeholder for that select. I've never typed that text on this field, Chrome is getting that from the placeholder of the input.

Chrome autofilling with placeholderGif

Also, it seems that Google saved that placeholder as a "suggestion" to fill data on forms. Chrome config

I've already tried to set those fields as autocomplete="off" and autocomplete="new-password and it did not work.

If I disable Chrome Option to autofill addresses, phone numbers and etc, this problem goes away.

I would like to be able to suppress chrome from suggesting this since it does not make any sense and makes using the filter a pain. I'm not sure if this is a chrome bug, a bug with select2, a combination of both. I've been looking everywhere on the internet to a solution and could not find one, does anybody know how to solve this?

like image 871
Lucas Felipe da Cunha Avatar asked May 17 '19 19:05

Lucas Felipe da Cunha


People also ask

What is autofill form data in Chrome?

Autofill enables you to store certain data — such as your name, address, telephone number, and so on — in your browser, which you can then use to automatically fill in forms you come across online.\r\nThis handy feature doesn't come without its risks, though.


Video Answer


1 Answers

To turn off the auto suggestions which are displayed in chrome try adding

<input autocomplete="off">

Even after adding this if chrome tries to give you auto suggestion, the most widely used technique is to add an hidden input field above your field to solve this problem

<input style="display:none" type="password" name="pass"/>

Adding this above input must solve the problem

like image 177
Lokesh Kumar Avatar answered Oct 13 '22 07:10

Lokesh Kumar