Skip to content
This repository

Add option to show all Typeahead items #2043

Closed
reefdog opened this Issue February 17, 2012 · 5 comments

6 participants

Justin Reese Mark Otto Jacob Reed G. Law Gabriel Farrell Philipp
Justin Reese

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 Typeahead input 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 (assuming items was left at default 8). 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.

Jacob
Owner

Tagging this as a feature request

Matthew Urtnowski Murtnowski referenced this issue from a commit March 07, 2012
Commit has since been removed from the repository and is no longer available.
Matthew Urtnowski Murtnowski referenced this issue from a commit March 07, 2012
Commit has since been removed from the repository and is no longer available.
Matthew Urtnowski Murtnowski referenced this issue from a commit March 07, 2012
Commit has since been removed from the repository and is no longer available.
Matthew Urtnowski Murtnowski referenced this issue from a commit March 07, 2012
Commit has since been removed from the repository and is no longer available.
Matthew Urtnowski Murtnowski referenced this issue from a commit in Murtnowski/bootstrap March 07, 2012
Matthew Urtnowski Resolved Issue #2043
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
1386772
Matthew Urtnowski Murtnowski referenced this issue from a commit in Murtnowski/bootstrap March 08, 2012
Matthew Urtnowski Resolved Issue #2043
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
a64bdd2
Matthew Urtnowski Murtnowski referenced this issue from a commit in Murtnowski/bootstrap March 08, 2012
Matthew Urtnowski Resolved Issue #2043
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
d8eaab7
Reed G. Law

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.

Gabriel Farrell gsf referenced this issue from a commit June 26, 2012
Commit has since been removed from the repository and is no longer available.
Gabriel Farrell gsf referenced this issue from a commit in gsf/bootstrap June 26, 2012
Gabriel Farrell Added showAll option to show all items on focus 9b760c1
Gabriel Farrell gsf referenced this issue from a commit June 26, 2012
Commit has since been removed from the repository and is no longer available.
Gabriel Farrell gsf referenced this issue from a commit in gsf/bootstrap June 26, 2012
Gabriel Farrell Added showAll option to show all items on focus 8041b2d
Gabriel Farrell gsf referenced this issue June 26, 2012
Closed

2.1.0 wip showall #3941

Gabriel Farrell
gsf commented June 26, 2012

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.

Michael Cox michaelcox referenced this issue from a commit September 10, 2012
Commit has since been removed from the repository and is no longer available.
Michael Cox michaelcox referenced this issue from a commit September 11, 2012
Commit has since been removed from the repository and is no longer available.
Mark Otto mdo closed this February 05, 2013
Mark Otto
Owner

Closing as a dupe of #2042.

Philipp

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.