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.pull/21833/head
parent
0af77e8913
commit
710ee69418
|
@ -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…
Reference in New Issue