From f6f26fc635e10bd131a51d60c44728b5253d15aa Mon Sep 17 00:00:00 2001 From: rohit Date: Sun, 27 Jul 2025 23:52:59 +0530 Subject: [PATCH] Fix: Prevent Ctrl+A from selecting timeline when input is focused --- apps/web/src/hooks/use-keybindings.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/src/hooks/use-keybindings.ts b/apps/web/src/hooks/use-keybindings.ts index 10616900..7f6505b0 100644 --- a/apps/web/src/hooks/use-keybindings.ts +++ b/apps/web/src/hooks/use-keybindings.ts @@ -24,6 +24,15 @@ export function useKeybindingsListener() { const boundAction = keybindings[binding]; if (!boundAction) return; + const activeElement = document.activeElement; + const isTextInput = + activeElement && + (activeElement.tagName === "INPUT" || + activeElement.tagName === "TEXTAREA" || + (activeElement as HTMLElement).isContentEditable); + + if (isTextInput) return; + ev.preventDefault(); // Handle actions with default arguments