JQuery autocomplete issue - Shift key behaves the same as return key
In the search bar, start typing "san f" (no quotes, all lowercase), then press Return (or Enter). San Francisco is auto-complete. It's good!
Now clear the search box and start over. type "San F" and arrow - "San Francisco" autocomplete as soon as you press Shift. This is not expected.
This happens in FF and Safari, but has not been tested elsewhere. I have looked at the jQuery autocomplete source code and everything looks fine.
Has anyone experienced this before?
+2
a source to share
3 answers
Try the autocomplete search option like below:
$(function() {
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$( "#tags" ).autocomplete({
source: availableTags,
search: function( event, ui ) {
if(event.which == 16 || event.which == 17 )
event.preventDefault();
}
});
0
a source to share