Skip to content

Commit c7f02db

Browse files
author
Tomas Kirda
authored
Merge pull request devbridge#715 from mdinsmore/master
Fix chrome autocomplete issue
2 parents 3927f79 + 543cdf9 commit c7f02db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/jquery.autocomplete.js

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

166166
// Remove autocomplete attribute to prevent native suggestions:
167-
that.element.setAttribute('autocomplete', 'off');
167+
// as per
168+
// https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
169+
// some browsers e.g. Google Chrome ignore autocomplete=off but autocomplete=nope
170+
// will provide the correct behaviour
171+
that.element.setAttribute('autocomplete', 'nope');
168172

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

0 commit comments

Comments
 (0)