I want to implement an initial fallback similar to the Twitter web application, where it has the final option to autocomplete the input value (for example, Search all people for {{input.val()}} ):

My current implementation failed because Typeahead.js does not reload local data arrays, so the desired effect only occurs in the first keyup event:
var plusone = [ { value: '', tokens: '' } ]; $('#name').keyup(function () { plusone[0].value = $('#name').val(); plusone[0].tokens = $('#name').val(); }); $('#name').typeahead( [ { local: plusone } ] );
According to the documentation and this tutorial, it is not possible to reinitialize typeahead without destroying it first, which I would rather not have done for performance. Any suggestions for a better implementation or fix would be greatly appreciated (if anyone from Twitter is there, I would like to know your implementation).
source share