2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-12-22 10:58:55 +00:00

Fix chrome autocomplete issue

This commit is contained in:
mdinsmore 2018-05-30 11:38:20 +01:00 committed by GitHub
parent 3927f7960f
commit 543cdf98bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 = $('<div class="autocomplete-no-suggestion"></div>')