Skip to content

Commit 663c0e3

Browse files
committed
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 devbridge#677
1 parent 75a8ae9 commit 663c0e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jquery.autocomplete.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
container;
165165

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

169169
// html() deals with many types: htmlString or Element or Array or jQuery
170170
that.noSuggestionsContainer = $('<div class="autocomplete-no-suggestion"></div>')

0 commit comments

Comments
 (0)