Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keep ui autocomplete open at all times

I'm using the ui autocomplete: over here

I need the autocomplete to be open at all times, so it shouldn't close when somewhere in the body is clicked. I have googled this but I couldn't find anything.

like image 798
Youss Avatar asked Feb 05 '12 11:02

Youss


1 Answers

Hey sorry for the late response!

I feel this is a lot cleaner than keeping focus on the input and searching multiple times.

Try this...

JAVASCRIPT:

$( "#input1" ).autocomplete({
    source: availableTags,
    close : function (event, ui) {
        if (!$("ul.ui-autocomplete").is(":visible")) {
            $("ul.ui-autocomplete").show();
        }
    }
});

DEMO: http://jsfiddle.net/dirtyd77/AJtvJ/

Hope this helps!

like image 159
Dom Avatar answered Sep 20 '22 18:09

Dom