The bug founded when I enter the value to the texbox while I am mouse over the autocomplete menu, when I mouse out the menu the textbox gain the original value even when I put focus: return false.
<label for="tags">Tags: </label>
<input id="tags" />
var availableTags = [
"ActionScript",
"AppleScript",
"Asp",
"BASIC",
"C",
"C++",
"Clojure",
"COBOL",
"ColdFusion",
"Erlang",
"Fortran",
"Groovy",
"Haskell",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
var tags = $("#tags").autocomplete({
source: availableTags,
focus: function(event, ui){
return false;
}
});
availableTags.push("foo");
tags.autocomplete( "option", "source", availableTags);
window.setTimeout(function(){$("#tags").val("BASIC")},10000 );
What I am doing is puttin “BASIC” value after 10 secs and if you have the mouse over the autocomplete menu than when you will mouse out the #tags value will be back to origin and I don’t want this to happen.
Can I workaround this?! How?! thanks
It was corrected on the next release so for the moment you have to use:
and not the downloaded from jquery-ui site.