2

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.

1 Answer 1

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: [/* ... */]
});
2
  • 1
    Thanks! I've temporarily switched from using Twitter Typeahead for the sake of productivity, but I'll try this in the future
    – Meredith
    Jul 16, 2013 at 18:31
  • 2
    I have it set like this: $('.typeahead').typeahead(null, { minLength: 3, displayKey: 'value', source: geoLocation.ttAdapter() }); But still makes request at the first typing May 26, 2014 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.