Skip to content

The open-source CapCut alternative

Fix: Prevent Ctrl+A from selecting timeline when input is focused

rohitf6f26fc635e1
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