jquery / jquery-ui

The official jQuery user interface library.
https://jqueryui.com
Other
11.26k stars 5.32k forks source link

autocomplete="off" is not sufficient anymore #1982

Open mokraemer opened 3 years ago

mokraemer commented 3 years ago

e.g. in component autocomplete, the attribute autocomplete is set to off to prevent the browser from autofilling. In many cases the browser ignores this attribute with "off". It looks like setting "one-time-code" will prevent it from autofilling.

melloware commented 3 years ago

It loos like that is Apple IOS and Mac only? https://robindirksen.com/blog/html-autocomplete-one-time-code

mokraemer commented 3 years ago

nope. chrome shows autocompletion of predefined user data (e.g. my adress and others). With this setting it disappears. Most browsers just ignore the setting "off" and handle them as "not set" :(

lebbe commented 3 years ago

You need to set autocomplete="off" on the surrounding form tag as well, for Chrome to respect this attribute. Chrome ignores it if only placed on the input element itself (and the developers know about it https://bugs.chromium.org/p/chromium/issues/detail?id=914451).

mokraemer commented 3 years ago

I've reverted my change - it has other implications.

The problem results from the label "Name" if other labels in (any?) other form have the name "street" or anything. Looks like chrome thinks it is super intelligent :( renaming the label helped....

skaestle commented 2 years ago

https://bugs.chromium.org/p/chromium/issues/detail?id=1133769

mokraemer commented 2 years ago

nice post. thanks

dominik5566 commented 1 year ago

It would be nice if this was fixed. Currently this is the best resource on StackOverflow on this topic https://stackoverflow.com/questions/15738259/disabling-chrome-autofill

If it is not possible to solve this by setting autocomplete="new-selectbox-item" or similar, which worked for me, then I would suggest to at least not override the attribute if it is already set on the input field.