UI Bootstrap listahead list - don't select / highlight first item

I am using UT bootstrap typeahead and it picks the first term by default. Here's the issue . But since I am limiting the offers on the list, so all the offers will not be on the list. Now, if the user is looking for any term, then automatically the first term will be searched by default, not by the entered term. I want to search for the default term I entered. I just want to remove the auto select feature.

For this I found a hacked github page to add $viewvalue

to the dropdown:

typeahead="state for state in (states.length ? [$viewValue].concat(states) : [])"

      

Plnker

Edit [works]:

And as per my need, I changed it as:

typeahead="student for student in ((students.concat({name:$viewValue})) |filter:{name:$viewValue} | limitTo:8)"

      

Any other suggestions for removing the default auto-selection?

+3


source to share


1 answer


Add Attribute typeahead-focus-first=false



Ref: https://www.bountysource.com/issues/5720762-typeahead-focus-first-false-option-to-prevent-first-match-from-being-focused

0


source







All Articles