I am using Twitter Bootstrap's typehead for search suggestions. When a key is pressed any previously loaded results disappear while new results are loaded by AJAX.
This is the code I am using:
el.typeahead(
{ highlight: true },
{
limit: 10,
name: type,
source: ob.typheadSource,
templates: { suggestion: ob.typeheadSuggeestion }
}
);
The source property is a function which loads data via AJAX and the templates property provides another function to handle the result of that AJAX call.
Is there a way to leave the previous result, until the new request has been completed and can be inserted without causing a flicker?