diff options
| author | Maze <167211895+mazeincoding@users.noreply.github.com> | 2025-07-28 00:13:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-28 00:13:07 +0200 |
| commit | 2e0c9f4b234a4782c40f90a52b575cad65b85412 (patch) | |
| tree | cae7641eaabff17c45222386a3ac79434bcf9dc9 | |
| parent | d154937ac2fdf5877095c4a0f1076cba04d7c3d1 (diff) | |
| parent | f6f26fc635e10bd131a51d60c44728b5253d15aa (diff) | |
| download | opencut-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
| -rw-r--r-- | apps/web/src/hooks/use-keybindings.ts | 9 |
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 |
