Autocomplete > focus input field

I’d like my input field to be autofocused when the page loads, however it appears that something in autocomplete.js is overwriting this?

My input field looks like: <input type="search" id="aa-search-input" class="aa-input-search" placeholder="Search ingredients" name="search" autocomplete="off" autofocus/>

It autofocuses for a second, then looses focus. I’m not seeing anything in the autocomplete.js docs about this.

Hi @alexhollender, can you give us a example website reproducing the issue? So that we can better help you, thanks!

What was the solution to this? I’m experiencing the exact same issue.

@goyocode unfortunately I have not yet taken the time to debug this and solve it properly. For now I’m just using a workaround, which is to wait 1 second and then set the input to focus using js:

setTimeout(function(){ 
  $('input').focus();
}, 100);

Thanks! I tried the following and it also seems to work:

$(function() {
    $('input').focus();
});