Skip to content

Commit

Permalink
Only update autcomplete results if current query matches server response
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 14, 2014
1 parent 7ea6edc commit 016f630
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions imp/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,11 @@ var IMP_Autocompleter = Class.create({
'autocompleteSearch',
Object.extend(this.p.autocompleterParams, { search: t }),
{
callback: function(r) {
this.updateAutocomplete(t, this.cache.set(t, r.results));
callback: function(r, ajax) {
this.cache.set(t, r.results);
if (ajax.request.parameters.search == $F(this.input)) {
this.updateAutocomplete(t, r.results);
}
}.bind(this)
}
);
Expand Down

0 comments on commit 016f630

Please sign in to comment.