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

autocomplete="off" does not work in chrome #247

Closed
sdwvit opened this issue Aug 16, 2018 · 18 comments · Fixed by #250
Closed

autocomplete="off" does not work in chrome #247

sdwvit opened this issue Aug 16, 2018 · 18 comments · Fixed by #250

Comments

@sdwvit
Copy link
Contributor

sdwvit commented Aug 16, 2018

See https://bugs.chromium.org/p/chromium/issues/detail?id=370363#c7

Expected behaviour: chrome native autocomplete is not drawn on top of autocomplete.js autocomplete.

Workaround (either):

  • use autocomplete="new-password"
  • insert input <input style="opacity: 0; position: absolute" /> right before your autocompleted input
@Haroenv
Copy link
Contributor

Haroenv commented Aug 17, 2018

hmm, this doesn't happen to me on busbud, did you fix it there? This definitely seems like a nasty bug in Chrome. Maybe it has something to do with having autofill enabled on that website before?

Could you share a bit more in which setup is necessary for this to happen?

@Haroenv
Copy link
Contributor

Haroenv commented Aug 17, 2018

Note that the off value is the one that makes it work in FF and Safari, so I fear it will be hard to value both of those requirements

@sdwvit
Copy link
Contributor Author

sdwvit commented Aug 17, 2018

@Haroenv yes, fixed yesterday with one of the workarounds, specifically, by adding additional hidden input

Maybe it has something to do with having autofill enabled on that website before?

exactly, you have to be returning user, which uses our search form multiple times

see video of repro:

https://www.youtube.com/watch?v=ByfqCOAQXZI

Unfortunately, I have no right to setup preview env for you to see bug on busbud in action. Let me know if video is unclear.

@Haroenv
Copy link
Contributor

Haroenv commented Aug 17, 2018

Thanks for your detailed bug report by the way, we will try to see if we can find a solution. It might be quite simple to implement here since we already have two inputs. It would be really nice if you already have to solution to take a look if you can do a PR 😄

@sdwvit
Copy link
Contributor Author

sdwvit commented Aug 17, 2018

Can't promise, but will try to find time to do a pr on weekends.

@Haroenv
Copy link
Contributor

Haroenv commented Aug 18, 2018

Cool! If you don’t find time to do a PR, a clear suggestion on which attribute to change where would also be sufficient, it’s still pretty confusing what to put where :)

@Braunson
Copy link

Braunson commented Aug 24, 2018

I'm having this issue (intermittenly) with various clients. Chrome ignores the autocomplete="off" attribute.

A workaround is to instead set the value of autocomplete to nope. Can we make override or stop the override by the autocomplete.js script? I don't think it's a fix-all solution but it seems to work for Chrome in this case.

@sdwvit
Copy link
Contributor Author

sdwvit commented Aug 24, 2018

@Braunson does it work for other browsers like safari/firefox?

@Haroenv I'm still observing weird autocomplete behaviour with proposed double-input fix on local environment, however it works on prod. 🤷‍♂️Will investigate on my side and post the results here.

@Braunson
Copy link

Braunson commented Aug 25, 2018

@sdwvit From what I understand from reading bug logs / other people's feedback is that it depends on specific versions of each browser. Some obey the autocomplete=off flag, others do-not. It varies browser version to browser version.

I'm not able to re-create this at all on my local machine but I'm seeing clients and other users with this issue.

@Haroenv
Copy link
Contributor

Haroenv commented Aug 27, 2018

Thanks for your research, it still needs to be checked, but it seems like in some situations the browser, specifically Chrome, doesn't listen to autocomplete=off. I think we should go for autocomplete=none, or autocomplete=something-random-234234 to avoid collisions.

@MatTheCat
Copy link

nope comes from https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

I observed the issue on my machine and changing autocomplete seemed to fix it.

@Haroenv Haroenv added the minor label Aug 30, 2018
@Haroenv
Copy link
Contributor

Haroenv commented Aug 30, 2018

Seems like this is decided then, let's change off to nope on all our inputs. If someone is up for a contribution, this would be good!

@sdwvit
Copy link
Contributor Author

sdwvit commented Aug 30, 2018

Here you are @Haroenv ^

@Braunson
Copy link

Braunson commented Dec 4, 2018

Just a heads up, it seems the latest version of Chrome is ignoring autocomplete attribute regardless of what your using nope or `off.

@Haroenv
Copy link
Contributor

Haroenv commented Dec 4, 2018

ugh, this is extremely annoying. Sorry that we can't fix this any more than already done. Thanks for the heads-up @Braunson.

Do you know of a write-up somewhere on the situation?

@Braunson
Copy link

Braunson commented Dec 4, 2018

@Haroenv I'm looking for the Google Bug ticket link but it was a 1.5 months ago, Google may have re-enabled watching it again. Not a ton that can be done anyway until Chrome starts respecting the attribute 😄

@sdwvit
Copy link
Contributor Author

sdwvit commented Dec 4, 2018

thanks for the heads up @Braunson
I am observing a spike in random inputs in our analytics and wondering what is the cause

@PictureElement
Copy link

Check the following plugin: https://terrylinooo.github.io/jquery.disableAutoFill/

It works by randomizing the input name value to prevent Chrome to remember what you filled. It will restore back to original field name when submitting the form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants