Skip to content
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

Closed
reefdog opened this issue Feb 17, 2012 · 5 comments
Closed

Add option to show all Typeahead items #2043

reefdog opened this issue Feb 17, 2012 · 5 comments

Comments

@reefdog
Copy link

reefdog commented Feb 17, 2012

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.

@fat
Copy link
Member

fat commented Feb 25, 2012

Tagging this as a feature request

Murtnowski added a commit to Murtnowski/bootstrap that referenced this issue Mar 8, 2012
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
Murtnowski added a commit to Murtnowski/bootstrap that referenced this issue Mar 8, 2012
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
Murtnowski added a commit to Murtnowski/bootstrap that referenced this issue Mar 8, 2012
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
@reedlaw
Copy link

reedlaw commented Jun 25, 2012

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.

gsf pushed a commit to gsf/bootstrap that referenced this issue Jun 26, 2012
gsf pushed a commit to gsf/bootstrap that referenced this issue Jun 26, 2012
@gsf
Copy link

gsf commented Jun 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.

@mdo
Copy link
Member

mdo commented Feb 6, 2013

Closing as a dupe of #2042.

@mdo mdo closed this as completed Feb 6, 2013
@ptnplanet
Copy link

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
Projects
None yet
Development

No branches or pull requests

6 participants