fix: skip keyboard handler when focus is in a text input
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
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 <noreply@anthropic.com>
This commit is contained in:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user