Friday, 25 May 2018

Jquery ui autocomplete autoFocus on android device

I am using Jquery ui autocomplete.

I am using the autoFocus option so that as soon as the autocomplete list is shown, the first option is automatically selected.

This is a fiddle. The autocomplete code is:

$(".ac").autocomplete({
        source: availableTags,
        autoFocus: true
    });

However, if this is tested on a chrome browser on android, then for any non-last form input, the item isn't selected.

Upon inspection, I noticed that the "enter" (button on bottom right of keyboard) button on an android device for any non-last input element in a form is "Next" while the "enter" button for the last input element of the form is "Go".

The issue I described only occurs when the "enter" button is "Next" (ie: any non-last input element).

Are there any suggestions for how I might fix this issue? That is, how can I have the "enter" key select the auto focused element on an android Chrome browser?

Thanks



from Jquery ui autocomplete autoFocus on android device

No comments:

Post a Comment