Normalize keyboard shortcut keys to lowercase for consistent handling

This commit is contained in:
Anwarul Islam
2025-07-18 06:27:31 +06:00
parent c391eb8616
commit 4b80c14982
+6 -2
View File
@@ -292,7 +292,7 @@ export const useKeyboardShortcuts = (
parts.push(e.key); parts.push(e.key);
return parts.join("+"); return parts.join("+").toLowerCase();
}, []); }, []);
// Handle keyboard events // Handle keyboard events
@@ -302,7 +302,11 @@ export const useKeyboardShortcuts = (
const keyCombo = parseKeyboardEvent(e); const keyCombo = parseKeyboardEvent(e);
const shortcut = shortcuts.find((s) => const shortcut = shortcuts.find((s) =>
s.keys.some((key) => key === keyCombo || key === e.key) s.keys.some(
(key) =>
key.toLowerCase() === keyCombo ||
key.toLowerCase() === e.key.toLowerCase()
)
); );
if (shortcut) { if (shortcut) {