New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to show all Typeahead items #2043
Comments
Tagging this as a feature request |
Added variable focusshow which defaults to false When focusshow is true, it makes it so when you gain focus on typeahead it causes the menu to show up. I added a focus listener to catch when the typeahead gains focus I added a method called showmenu when will show then menu when typeahead gains focus
Added variable focusshow which defaults to false When focusshow is true, it makes it so when you gain focus on typeahead it causes the menu to show up. I added a focus listener to catch when the typeahead gains focus I added a method called showmenu when will show then menu when typeahead gains focus
Added variable focusshow which defaults to false When focusshow is true, it makes it so when you gain focus on typeahead it causes the menu to show up. I added a focus listener to catch when the typeahead gains focus I added a method called showmenu when will show then menu when typeahead gains focus
A possibly related issue is that typeahead hides ajax results that should be shown if the search term is not an exact substring of the results. For example, typing "lax" using Google Places Autocomplete returns "L.A.X., Los Angeles, CA, United States" as the first result but this will not be shown because "lax" doesn't have dots after each letter. So if there was an option to always show 5 items regardless of exact match it might solve this problem. |
Apologies, I should have left those refs out of the commit. The pull requests (one for master and one for 2.1.0-wip) add a test and functionality for a "showAll" option. When it's true the typeahead shows all items in the source, up to the number in the "items" option, on focus. As you can see in the commit, only 6 lines of code are affected. Now I'm thinking "focusShow" (as suggested in #2474) might be a more descriptive name for the option. |
Closing as a dupe of #2042. |
I've built an extension to bootstrap's typeahead plugin to provide the behavior you are looking for. Have a look here: https://github.com/ptnplanet/Bootstrap-Better-Typeahead |
Currently, the menu of items doesn't appear until you start typing. Normally this is fine, but sometimes I'd like the user to see the sorts of items in the list before typing.
I propose adding an option which, if set to true, goes ahead and shows the menu (along with first
items
number of items) as soon as the Typeaheadinput
is focused. This option would default false to match current behavior.So in the State example, when the
input
was focused, the menu would open and show Alabama through Delaware (assumingitems
was left at default8
). This prompts the user for the sort of string we're expecting them to type.One could argue "but if we pop open a list of items, they may think that's all the items that are offered" which could be negated by #2042.
The text was updated successfully, but these errors were encountered: