jQuery UI Autocomplete: Determine if search window is open?

Viewed 7384

I want to trigger a search in the onclick event of my input, but only if the search window isn't already open. Presently, I do this:

$(this).bind('click.ajaxselect', function(e) {
    if(!$(this).autocomplete('widget').is(':visible')) {
        $(this).autocomplete('search','');
    }
});

But I'm not overly fond of using the :visible selector because it searches up through all the parents as well. Is there some property I can check?

Dialog has this isOpen method, does autocomplete have something similar?

2 Answers
Related