I'm using the autocomplete mod from
http://www.pengoworks.com/workshop/jquery/autocomplete.htm
The page above uses an older version of jQuery; with the latest, a bug
occurs: when hitting enter without having selected any item in the
drop-down, the whole dropdown innerHTML gets written to the target textbox;
To fix, I modified line 154 from
if (!li) {
to
if (!li || li.tagName.toLowerCase() != 'li') {
and set the option 'selectFirst' to true
this is because line 153
var li = $("li.ac_over", results)[0];
now evaluates to the whole ac.results div when no item is selected (with the
older jQuery version used on the site it eval'd to false).
Any insights? Perhaps a more elegant way to solve this?
--
View this message in context:
http://www.nabble.com/Autocomplete-mod-tweak-tf3217248.html#a8934891
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/