summaryrefslogtreecommitdiff
path: root/apps/web/src/hooks
diff options
context:
space:
mode:
authorMaze <167211895+mazeincoding@users.noreply.github.com>2025-07-28 00:13:07 +0200
committerGitHub <noreply@github.com>2025-07-28 00:13:07 +0200
commit2e0c9f4b234a4782c40f90a52b575cad65b85412 (patch)
treecae7641eaabff17c45222386a3ac79434bcf9dc9 /apps/web/src/hooks
parentd154937ac2fdf5877095c4a0f1076cba04d7c3d1 (diff)
parentf6f26fc635e10bd131a51d60c44728b5253d15aa (diff)
downloadopencut-2e0c9f4b234a4782c40f90a52b575cad65b85412.tar.gz
Merge pull request #472 from RohitChandel23/fix/462-select-all-focus-bug
Fix: Prevent Ctrl+A from selecting timeline when input is focused
Diffstat (limited to 'apps/web/src/hooks')
-rw-r--r--apps/web/src/hooks/use-keybindings.ts9
1 files changed, 9 insertions, 0 deletions
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