hakib/MassAutocomplete

Select first item when return key is pressed

byounathan opened this issue · 5 comments

Is it possible to select the first item in the list when return key is pressed?

hakib commented

Yes, you can set auto_select_first in the ac-options to True and the first option will be selected automatically.

Check out the options section in the gh-pages

I have already tried that option. It is different from what I am asking for. Instead of automatically selecting the first option after blur, I want the selection to occur when the user presses the return key.

hakib commented

Oh, sorry... I missed this subtle difference. There is no built-in way of doing it right now.

No worries, is this something that can be easily added?

hakib commented

I'm not sure you will be able to do it without forking this directive. Take a look at this section for the keyboard handling.