autoComplete.js icon indicating copy to clipboard operation
autoComplete.js copied to clipboard

Upgrade to JQuery Mobile 1.4.5

Open rubensgomes opened this issue 9 years ago • 2 comments

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

rubensgomes avatar Feb 12 '15 20:02 rubensgomes

Hello, I've had the same problem.Could you tell me how to solve this problem。

Thanks

sailkite avatar Jun 14 '15 15:06 sailkite

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(); } } .....

tonny-kohar avatar Jun 30 '15 07:06 tonny-kohar