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

Autocomplete when pressing Tab in same way it works when pressing Return

Open steswinbank opened this issue 13 years ago • 5 comments

Hi

Would it be possible to amend Typeahead so that a user can start typing, use the down-arrow to navigate to an option and then hit Tab to select that item? Currently this only works by pressing Return. Tab takes the focus to the next tabbable element leaving the text input with what the user typed in only. The desired behaviour would be for the selection of autocomplete option to take place if the user navigates to an option and then presses either Tab or Return.

Thanks Ste

steswinbank avatar May 23 '13 15:05 steswinbank

Implementing this behavior should be possible. I'll look into doing it some time in the future or if someone wants to work on it, I'll accept a pull request.

jharding avatar May 23 '13 19:05 jharding

Sorry but, can this be implemented as an option? We have a requirement not to auto select the first item when tab is pressed. Otherwise, how can this be achieved?

sprat avatar Jul 03 '13 13:07 sprat

Probably won't change this to being configurable through an option, but if you want to remove it, just remove tabKeyed from this line.

jharding avatar Jul 03 '13 19:07 jharding

+1

Amerr avatar Dec 16 '15 06:12 Amerr

@jharding I think it should be configurable. I have a use case where I have two textboxes beside each other with the autocomplete. I don't want the first value to be selected when the person means to just go to the next textbox.

imolorhe avatar Jul 02 '16 11:07 imolorhe