Chrome is autofilling my select2 input with its placeholder
Asked Answered
B

2

10

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 placeholder Gif

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?

Britneybritni answered 17/5, 2019 at 19:14 Comment(2)
Having the same problem, and haven't managed to find a solution for it yet.Keturahkeung
Any progress on this one? I am still facing the same issue.Denaturalize
F
1

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

Furniture answered 17/9, 2019 at 12:13 Comment(0)
C
0

Try to add another select2 with display="none", visibility="hidden" and autocomplete="off" before that one and see if the problem goes away.

Had this issue with a password input a while ago and that did the trick.

Conjunct answered 17/5, 2019 at 21:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.