Skip to content

Commit

Permalink
Merge pull request #489 from romainruaud/feature_autocomplete_debounce
Browse files Browse the repository at this point in the history
Adding debounce to autocomplete.
  • Loading branch information
afoucret authored Aug 9, 2017
2 parents e67677e + 0532030 commit 3eac047
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ define([
responseFieldElements: 'dl dd',
selectClass: 'selected',
submitBtn: 'button[type="submit"]',
searchLabel: '[data-role=minisearch-label]'
searchLabel: '[data-role=minisearch-label]',
debounceTimer: 500
},

/**
Expand Down Expand Up @@ -221,7 +222,7 @@ define([
*
* @private
*/
_onPropertyChange: function () {
_onPropertyChange: _.debounce(function () {
var searchField = this.element,
clonePosition = {
position: 'absolute',
Expand Down Expand Up @@ -308,7 +309,7 @@ define([
this._updateAriaHasPopup(false);
this.element.removeAttr('aria-activedescendant');
}
},
}, this.debounceTimer),

/**
* Executes when keys are pressed in the search input field. Performs specific actions
Expand Down

0 comments on commit 3eac047

Please sign in to comment.