From b81629681cc6e5770ab77860ffc3d2e937c3b98e Mon Sep 17 00:00:00 2001 From: Francisco Moretti Date: Thu, 20 Jun 2024 10:23:08 +0100 Subject: [PATCH] bugfix key can be mayus when shift pressed --- lib/hooks/use-hotkey.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/hooks/use-hotkey.tsx b/lib/hooks/use-hotkey.tsx index 3d52adbca1..2f097e223c 100644 --- a/lib/hooks/use-hotkey.tsx +++ b/lib/hooks/use-hotkey.tsx @@ -3,7 +3,11 @@ import { useEffect } from "react" const useHotkey = (key: string, callback: () => void): void => { useEffect(() => { const handleKeyDown = (event: KeyboardEvent): void => { - if (event.metaKey && event.shiftKey && event.key === key) { + if ( + event.metaKey && + event.shiftKey && + event.key.toLowerCase() === key.toLowerCase() + ) { event.preventDefault() callback() }