Don't try to match with an empty query string
This was causing UserProvider to give results because every string happens to start with empty string and its regex also acepts the empty string.
This commit is contained in:
parent
0af77e8913
commit
710ee69418
1 changed files with 3 additions and 0 deletions
|
@ -86,6 +86,9 @@ export default class QueryMatcher {
|
|||
if (this.options.shouldMatchWordsOnly) {
|
||||
query = query.replace(/[^\w]/g, '');
|
||||
}
|
||||
if (query.length === 0) {
|
||||
return [];
|
||||
}
|
||||
const results = [];
|
||||
this.keyMap.keys.forEach((key) => {
|
||||
let resultKey = key.toLowerCase();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue