Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

fix: command palette filter (#7981)

David Luzared5ce8d3ded0
diff --git a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
index 4147ca0853..36c9a9a687 100644
--- a/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
+++ b/packages/excalidraw/components/CommandPalette/CommandPalette.tsx
@@ -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,