Problem/Motivation

Chrome does not support the autocomplete="off" attribute.

Proposed resolution

Disable autocomplete in Chrome using workaround.
@see https://gist.github.com/niksumeiko/360164708c3b326bd1c8

Remaining tasks

Inputs affected

  • date picker
  • input hiding
  • autocomplete
  • filter
  • Algolia places

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Comments

jrockowitz created an issue. See original summary.

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new4.25 KB
jrockowitz’s picture

Issue summary: View changes

  • jrockowitz authored 4899ac5 on 8.x-5.x
    Issue #3066264 by jrockowitz: Disable autocomplete in Chrome
    
jrockowitz’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

dureaghin’s picture

StatusFileSize
new2.68 KB

Hi Jacob,
It seems that autocomplete "Off" no longer works.

I think you need set the autocomplete attribute to "off". With "chrome-off" does not work. I tested in browsers: Chrome and Microsoft Edge.
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site...

Please review attached patch.

Thanks,
Alex.

jrockowitz’s picture

Status: Closed (fixed) » Needs review
jrockowitz’s picture

Status: Needs review » Closed (works as designed)

Chrome is not supporting autocomplete="off" which is why we are using "chrome-off".

@see https://stackoverflow.com/questions/30053167/autocomplete-off-vs-false
@see https://www.google.com/search?q=disable+autocomplete+attribute+chrome

dureaghin’s picture

StatusFileSize
new139.4 KB
new41.25 KB
new39.49 KB

Hi Jacob,
Have you tried to test this? It looks like Google Chrome is no longer ignoring "off".
My Google Chrome version is 80.0.3987.87 (Official Build) (64-bit)

Steps to reproduce this issue:
1. Add text field element
2. Turn Autocomplete Off, clear drupal cache and opcache
3. View form and click on field

Here's my testing with autocomplete="chrome-off" and with autocomplete="off".
Please see attached screenshots.

Thanks,
Alex.

jrockowitz’s picture

StatusFileSize
new362.57 KB

I am still using Version 79.0.3945.130 (Official Build) (64-bit) and below are my results from https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_autocom....

dureaghin’s picture

This is not proper test, because https://www.w3schools.com/ is using iframe.
Try to test it from Drupal and you will see what I meant.

Thx.

dureaghin’s picture

StatusFileSize
new157.15 KB
new158.32 KB
jrockowitz’s picture

Status: Closed (works as designed) » Needs review
StatusFileSize
new3.76 KB

I was able to replicate the issue and using autocomplete="off" works as expected in Chrome.

The attached patch removes the chrome-off workaround.

dureaghin’s picture

Alright. So I tested your new patch and it works as expected.

Thanks,
Alex.

  • jrockowitz authored f218910 on 8.x-5.x
    Issue #3066264 by jrockowitz, dureaghin: Disable autocomplete in Chrome
    
jrockowitz’s picture

Status: Needs review » Fixed

I committed the latest patch. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

tostinni’s picture

StatusFileSize
new103.95 KB

Hi, I find that Chrome (80 but also the more recent Version 81.0.4044.92 (Official Build) (64-bit) for Mac) still autocompletes the input in conditionnal logic form.
Should this issue be reopened or should I create a new one ?

jrockowitz’s picture

Please create a new ticket. I also noticed the regression in Chrome on OSX

prabha.venkatesan’s picture

Hi @jrockowitz, the latest patch provided by you(3066264-14.patch) is working well. but it is not yet committed to the webform module. I have the latest webform version 8.x-5.19.
It would be great if you can commit this patch to the next webform update.

gun_dose’s picture

Very strange thing, but it seems, that without this patch in Chrome all works fine, but with this patch autocomplete still appears.

jrockowitz’s picture

Status: Closed (fixed) » Needs work

Chrome keeps changing how it handles autocompletion. The latest version of the webform module's autocomplete fix for Chrome is from #3126156: Disable autocomplete in Chrome macOS.

I am finding this issue so frustrating that I am ready to revert that patch and just start using autocomplete="off". We can just assume that Chrome will one day fix this issue.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new4 KB

The attached patch reverts the Chrome work-around and relies on autocomplete="off".

paulocs’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new3.29 KB
new10.08 KB

After I apply the patch #24 I could use the autocomplete feature without problem.
I try to use it before I apply the patch and I did not find any problem too.
Chrome version: Version 84.0.4147.125

Patch #24 looks good because it does not need to verify what the browser is.
Hope chrome will not change how the autocomplete works again.

I attached images after I applied the patch #24.

Cheers, Paulo.

jrockowitz’s picture

Status: Reviewed & tested by the community » Needs review

Sadly, I think a few more people need to review this before we commit the patch.

jrockowitz’s picture

@paulocs Thanks for reviewing the patch.

cecrs’s picture

Patch looks good and works for me.

jrockowitz’s picture

Status: Needs review » Reviewed & tested by the community

I will commit the patch and tag a new beta release.

  • jrockowitz authored 5a28cb2 on 8.x-5.x
    Issue #3066264 by jrockowitz, dureaghin, paulocs: Disable autocomplete...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

  • jrockowitz authored 5a28cb2 on 6.x
    Issue #3066264 by jrockowitz, dureaghin, paulocs: Disable autocomplete...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.