Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Should default suggestions be supported? #62

Closed
jharding opened this issue Feb 28, 2013 · 17 comments
Closed

Should default suggestions be supported? #62

jharding opened this issue Feb 28, 2013 · 17 comments
Assignees

Comments

@jharding
Copy link
Contributor

When typeaheads gain focus and no query has been entered yet, should we support default top suggestions? I could see how this could be useful.

You can sort of do this with the current implementation of typeahead.js by using '' as a token. It's a little buggy though because the hint is shown and it overlaps with the placeholder.

@timtrueman
Copy link
Contributor

I support this motion.

@DC3
Copy link

DC3 commented Mar 21, 2013

I support this motion too.
default suggestions could be useful.

@jharding
Copy link
Contributor Author

Should default suggestions only be shown when the query is blank or should it also be shown when no suggestions can be found? I lean towards the former.

@timtrueman
Copy link
Contributor

Blank. I could see how some people might want a message for no suggestions, but personally I'd never use it. No need to tell me there's no suggestions if I can see that for myself. I wonder what kind of overlap this logic might have with a zero minLength value, like #120 / #131

@augnustin
Copy link

I definitely support this motion. Very useful!

@ghost ghost assigned jharding Jul 10, 2013
@shaneardell
Copy link

Yes, please! I'm definitely in favor of the default suggestions being shown when the query is blank (to echo @timtrueman).

@SadiSKhan
Copy link

This is super important for me as well !

If there is an easy / cheesy hack for me to be able to do this now - I would greatly appreciate it. Thanks!

@nathanjones
Copy link

Would love to see this implemented as well.

I think it makes sense to follow the pattern Bootstrap's typeahead uses of showing suggestions immediately when minLength is 0.

@Manikandan-K
Copy link

I definitely support this one.. If there is no results for found for an query we should give indications that 'No results for this query'

@crockpotveggies
Copy link

Want to push support for this again. I understand a very recent pull request didn't do the job, I might see if I can whip something up.

@adambom
Copy link

adambom commented Mar 5, 2014

+1

@augnustin
Copy link

What's the situation here? Is there a branch we could use to test the feature? I'm kind of confused with all the pull requests in the history of this issue...

@jharding
Copy link
Contributor Author

Take a look at #719.

@augnustin
Copy link

Thanks for reply. Actually v0.10.2 messes up my display because of other new features (I guess something about class names transmitted).
How can I use the buggy version you suggest in the first comment of this issue? I tried by doing:

  $('#invited_for').typeahead({
    name: 'invited_for',
    minLength: 0,
    prefetch: {
      url: '/admin/invite_types.json',
      filter: function(data) {
        var el, res, _i, _len;
        res = [];
        for (_i = 0, _len = data.length; _i < _len; _i++) {
          el = data[_i];
          res.push({
            name: el,
            token: ''
          });
        }
        return res;
      }
    }
  });

But I haven't had any success yet. I'm using var VERSION = "0.9.3";
Thanks

@jharding
Copy link
Contributor Author

If I get a chance later today, I'll post what changes you need to make to get your code working with v0.10.2. In the meantime, I'd suggest taking a look at the migration guide to v0.10.0.

@augnustin
Copy link

Oh sweet! I should make it with your document. It's just that I realized there was no backward compatibility and it would take a little more time to integrate than just injecting 0.10 in my code. Thanks for active support 😄

@jharding jharding added this to the DOM and Style Customization milestone Jul 12, 2014
@jharding jharding modified the milestones: DOM and Style Customization, v0.11.0 Aug 15, 2014
@jharding
Copy link
Contributor Author

Closing in favor of #719.

@jharding jharding removed this from the v0.11.0 milestone Aug 18, 2014
jlbooker added a commit to jlbooker/typeahead.js that referenced this issue Nov 10, 2016
Allowing for custom setting of maxPendingRequests.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

10 participants