mirror of
https://github.com/OpenCut-app/OpenCut.git
synced 2026-07-13 21:52:53 +02:00
Merge pull request #472 from RohitChandel23/fix/462-select-all-focus-bug
Fix: Prevent Ctrl+A from selecting timeline when input is focused
This commit is contained in:
@@ -24,6 +24,15 @@ export function useKeybindingsListener() {
|
|||||||
const boundAction = keybindings[binding];
|
const boundAction = keybindings[binding];
|
||||||
if (!boundAction) return;
|
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();
|
ev.preventDefault();
|
||||||
|
|
||||||
// Handle actions with default arguments
|
// Handle actions with default arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user