From 543cdf98bd7c7e769ab70097b9caf957532165b2 Mon Sep 17 00:00:00 2001 From: mdinsmore Date: Wed, 30 May 2018 11:38:20 +0100 Subject: [PATCH] Fix chrome autocomplete issue --- src/jquery.autocomplete.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 173ac5e7..95f66c15 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -164,7 +164,11 @@ container; // Remove autocomplete attribute to prevent native suggestions: - that.element.setAttribute('autocomplete', 'off'); + // as per + // https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion + // some browsers e.g. Google Chrome ignore autocomplete=off but autocomplete=nope + // will provide the correct behaviour + that.element.setAttribute('autocomplete', 'nope'); // html() deals with many types: htmlString or Element or Array or jQuery that.noSuggestionsContainer = $('
')