Ignore events which don't change text input - fixes #1134 (#2846)

* Ignore events which don't change text input - fixes #1134

* Fix bind
This commit is contained in:
Tom Morris 2020-07-14 02:35:46 -04:00 committed by GitHub
parent 0645c2a726
commit 233cb95289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,8 +150,8 @@ TextSearchFacet.prototype._initializeUI = function() {
}
this._elmts.input.bind("keyup change input",function(evt) {
// Ignore non-character keyup changes
if(evt.type === "keyup" && (this.value === self._query || this.value === '' && !self._query)) {
// Ignore events which don't change our input value
if(this.value === self._query || this.value === '' && !self._query) {
return;
}
self._query = this.value;