user1596343
user1596343

Reputation: 101

let suggestion list pop up when entering the field

I have made a field with an autosuggestion. I set minLength to 0;

When I enter the textfield, I need to press a non-char key (i.e. arrow-down-key) to get the unfiltered full list of options.

I want this behaviour when I enter the field without pressing a key. I tried the following in my onFocus() event:

 $('myinput').autocomplete( "search" );

But that just does not work.

Upvotes: 1

Views: 161

Answers (1)

JoeFletch
JoeFletch

Reputation: 3960

I have done this in the past.

jsFiddle

$("input").autocomplete({
    minLength:0,
    source: ["one","two","three"]
    }).on("focus", function () { $(this).autocomplete("search"); });​

Upvotes: 1

Related Questions