I am using JQuery UI autocomplete. Everything works as expected, but when I cycle with the up/down keys on the keyboard, I notice that the textbox is filled with items in the list as expected, but when I reach the end of the list and hit the down arrow one more time, the original term that I typed shows up, which basically allows the user to submit that entry.
My question: Is there a simple way to limit the selection to the items in the list, and remove the text in the input from the keyboard selection?
eg: if I have a list that contains {'Apples (AA)', 'Oranges (AAA)', 'Carrots (A)'}
, if the user types 'app', I will automatically select the first item in the list ('Apples (AA)' here), but if the user presses the down arrow, 'app' shows up again in the textbox. How can I prevent that?
Thanks.
click
event to the item OR select the item – Differentiationfocus: function( event, ui ) { return false; }
– Differentiation