2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-25 14:17:45 +00:00

Fix disabling autofill in last versions of Chrome

Last versions of Google Chrome ignore property 'autocomplete="off"'. We need change it to 'autocomplete="new-password"' for disabling internal
Chrome autofill feature when plugin initialized. It works for any text fields, not only for password text fields.

Change
            // Remove autocomplete attribute to prevent native suggestions:
            that.element.setAttribute('autocomplete', 'off');
to:
            // Remove autocomplete attribute to prevent native suggestions:
            that.element.setAttribute('autocomplete', 'new-password');

Proof: https://stackoverflow.com/questions/15738259/disabling-chrome-autofill

Fix #677
This commit is contained in:
Ivan Matveev 2018-02-10 17:07:03 +03:00
parent 75a8ae9038
commit 663c0e35bb

View File

@ -164,7 +164,7 @@
container;
// Remove autocomplete attribute to prevent native suggestions:
that.element.setAttribute('autocomplete', 'off');
that.element.setAttribute('autocomplete', 'new-password');
// html() deals with many types: htmlString or Element or Array or jQuery
that.noSuggestionsContainer = $('<div class="autocomplete-no-suggestion"></div>')