From 663c0e35bba7e4f87487af794a8c4d640e08300d Mon Sep 17 00:00:00 2001 From: Ivan Matveev Date: Sat, 10 Feb 2018 17:07:03 +0300 Subject: [PATCH] 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 --- src/jquery.autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 173ac5e..ffc9efb 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -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 = $('
')