return;
}
this._bufferedValue = this.$('.js-search-input').val();
- if (this.searchRequest != null && this.searchRequest.abort != null) {
- this.searchRequest.abort();
- }
this.searchRequest = this.debouncedSearch(value);
},
const url = window.baseUrl + '/api/components/suggestions';
const options = { s: q };
return $.get(url, options).done(function (r) {
+ // if the input value has changed since we sent the request,
+ // just ignore the output, because another request already sent
+ if (q !== that._bufferedValue) {
+ return;
+ }
+
const collection = [];
r.results.forEach(function (domain) {
domain.items.forEach(function (item, index) {