Add option to show all Typeahead items #2043

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

Comments

Projects
None yet
6 participants
@reefdog

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

This comment has been minimized.

Show comment
Hide comment
@fat

fat Feb 25, 2012

Member

Tagging this as a feature request

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

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

Murtnowski added a commit to Murtnowski/bootstrap that referenced this issue Mar 8, 2012

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

Murtnowski added a commit to Murtnowski/bootstrap that referenced this issue Mar 8, 2012

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
@reedlaw

This comment has been minimized.

Show comment
Hide comment
@reedlaw

reedlaw 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.

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

This comment has been minimized.

Show comment
Hide comment
@gsf

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

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.

michaelcox added a commit to michaelcox/bootstrap that referenced this issue Sep 11, 2012

@mdo

This comment has been minimized.

Show comment
Hide comment
@mdo

mdo Feb 6, 2013

Member

Closing as a dupe of #2042.

Member

mdo commented Feb 6, 2013

Closing as a dupe of #2042.

@mdo mdo closed this Feb 6, 2013

@ptnplanet

This comment has been minimized.

Show comment
Hide comment
@ptnplanet

ptnplanet Apr 22, 2013

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

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