From bb482902a8b7eab1325bd9a1da8c5793444e9753 Mon Sep 17 00:00:00 2001 From: Alina Date: Wed, 18 Feb 2026 13:43:55 +0300 Subject: [PATCH] fix: skip keyboard handler when focus is in a text input Prevents useKeyboard from intercepting keypresses while the user is typing in an input or textarea field, which caused wrong characters to appear instead of Russian text. Co-Authored-By: Claude Opus 4.6 --- src/hooks/useKeyboard.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/useKeyboard.ts b/src/hooks/useKeyboard.ts index 3fa7c84..5dac829 100644 --- a/src/hooks/useKeyboard.ts +++ b/src/hooks/useKeyboard.ts @@ -17,6 +17,9 @@ export function useKeyboard(actions: CalculatorActions) { const handleKeyDown = useCallback( (e: KeyboardEvent) => { + const tag = (e.target as HTMLElement)?.tagName; + if (tag === 'INPUT' || tag === 'TEXTAREA') return; + const mapped = KEY_MAP[e.key]; if (!mapped) return;