admin管理员组

文章数量:1426004

I'm using Twitter's Typeahead.js (Not the one included in Bootstrap) and I was wondering if there was a similar function to minLength=0 that exists in Better-Typeahead (Bootstrap)

Triggering on input looked promising, but I don't want there to be any text in the input box when the dropdown is triggered.

I'm using Twitter's Typeahead.js (Not the one included in Bootstrap) and I was wondering if there was a similar function to minLength=0 that exists in Better-Typeahead (Bootstrap)

Triggering on input looked promising, but I don't want there to be any text in the input box when the dropdown is triggered.

Share Improve this question edited May 23, 2017 at 12:28 CommunityBot 11 silver badge asked Jul 2, 2013 at 23:21 MeredithMeredith 4,4845 gold badges36 silver badges58 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

Yep, Datasets have a minLength option, see the code here. It's been around since v0.9.1, but it hasn't made its way to the README yet.

Here's how you'd use it:

$('.typeahead').typeahead({
  minLength: 3,
  local: [/* ... */]
});

本文标签: javascriptTwitter Typeahead min length0 equivalentStack Overflow