Merge pull request #1469 from Estebene/search-filter

Fixed search filter bug
This commit is contained in:
Jack 2021-05-26 23:55:16 +01:00 committed by GitHub
commit d49cdcebca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,10 +95,8 @@ function updateSuggested() {
let escaped = obj2.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
let re = new RegExp("\\b" + escaped, "g");
let res = obj.display.toLowerCase().match(re);
let res2 = null;
if (obj.alias !== undefined) {
res2 = obj.alias.toLowerCase().match(re);
}
let res2 =
obj.alias !== undefined ? obj.alias.toLowerCase().match(re) : null;
if (
(res != null && res.length > 0) ||
(res2 != null && res2.length > 0)
@ -108,7 +106,7 @@ function updateSuggested() {
foundcount--;
}
});
if (foundcount > 0) {
if (foundcount > inputVal.length - 1) {
obj.found = true;
} else {
obj.found = false;