autoComplete.js
autoComplete.js copied to clipboard
Upgrade to JQuery Mobile 1.4.5
Hello,
I am using your autocomplete on EZLista Mobile which is based on JQuery Mobile 1.4.5. And I noticed that when using the desktop up and down keys to select an item only the first item of the list is selected. Therefore, there appears to have an issue using the up/down keys from a desktop.
Rubens
Hello, I've had the same problem.Could you tell me how to solve this problem。
Thanks
under the function handleInput, replace the original code (the relevant section) with ..... ..... if (e) { if (e.keyCode === 38) { // up $('.ui-btn-active', $(settings.target)) .removeClass('ui-btn-active').parent().prev('li').find('.ui-btn') .addClass('ui-btn-active').length || $('.ui-btn:last', $(settings.target)).addClass('ui-btn-active'); } else if (e.keyCode === 40) { $('.ui-btn-active', $(settings.target)) .removeClass('ui-btn-active').parent().next('li').find('.ui-btn') .addClass('ui-btn-active').length || $('.ui-btn:first', $(settings.target)).addClass('ui-btn-active'); } else if (e.keyCode === 13 && settings.forceFirstChoiceOnEnterKey) { $('.ui-btn-active', $(settings.target)).click().length || $('.ui-btn:first', $(settings.target)).click(); } } .....