fix: command palette filter (#7981)

This commit is contained in:
David Luzar 2024-05-08 17:56:05 +02:00 committed by GitHub
parent 1ed53b153c
commit ed5ce8d3de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -540,7 +540,7 @@ function CommandPaletteInner({
...command,
icon: command.icon || boltIcon,
order: command.order ?? getCategoryOrder(command.category),
haystack: `${deburr(command.label)} ${
haystack: `${deburr(command.label.toLocaleLowerCase())} ${
command.keywords?.join(" ") || ""
}`,
};
@ -777,7 +777,9 @@ function CommandPaletteInner({
return;
}
const _query = deburr(commandSearch.replace(/[<>-_| ]/g, ""));
const _query = deburr(
commandSearch.toLocaleLowerCase().replace(/[<>_| -]/g, ""),
);
matchingCommands = fuzzy
.filter(_query, matchingCommands, {
extract: (command) => command.haystack,