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

TAB event doesn't trigger typeahead:selecetd

Open a-lucas opened this issue 12 years ago • 5 comments

How to repeat :

 var myCustomCallback = function(eventObject, suggestionObject, datasetName) {
    alert('hello');
 }

myTypeAhead.on('typeahead:selected', myCustomCallback);

Then navigate on your autocomplete field, type few letter so you get a list of items, and then press TAB. It will select the first item, but it won't trigger the :selected event.

a-lucas avatar Mar 04 '14 06:03 a-lucas

This would be great as an option. I am sure some people might not want TAB to trigger selected, but I (and apparently the OP) would find it useful.

Maybe an addition to "autoselect" where TAB could also be used in addition to "ENTER"

Wbmstrmjb avatar Mar 04 '14 23:03 Wbmstrmjb

I was asked about this feature last week. It would be very nice to have.

RobRolls avatar Mar 04 '14 23:03 RobRolls

It won't trigger typeahead:selected because nothing was selected. Instead, the value of the input control was updated to be whatever the value of the showing hint was. You can capture this event by listening for typeahead:autocompleted.

Maybe an addition to "autoselect" where TAB could also be used in addition to "ENTER"

I'm actually hoping to kill off the existing, half-baked autoselect functionality in the existing typeahead.js jQuery plugin. I want the scope of the existing plugin to be for search input controls that accept free-form values i.e. don't have to originate from a suggestion. I realize a bunch of people want autoselect functionality though so what I'd like to do is build an additional plugin that's meant to behave as an advanced select control. There's no timeframe for any of this, but I figured I'd share my plans anyways.

jharding avatar Mar 09 '14 10:03 jharding

I am not sure why this has been closed. Is it now implemented ?

a-lucas avatar Dec 09 '14 03:12 a-lucas

@jharding it works great with typeahead:autocompleted thanks alot.

channainfo avatar Jan 27 '15 10:01 channainfo