From bcf66145c249dcb956dd45e376f8b8770b5aebea Mon Sep 17 00:00:00 2001 From: Uriel Date: Tue, 9 Apr 2024 17:38:30 -0300 Subject: [PATCH] Make only search bar keybinds be prevented (#981) --- gui/src/App.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gui/src/App.tsx b/gui/src/App.tsx index e633ac08b2..02d09dbd5b 100644 --- a/gui/src/App.tsx +++ b/gui/src/App.tsx @@ -162,9 +162,15 @@ export default function App() { const isTauri = useIsTauri(); useEffect(() => { - const onKeydown: (arg0: KeyboardEvent) => void = function (e) { - // seems to be sufficient to prevent most default shortcuts - e.preventDefault(); + const onKeydown: (arg0: KeyboardEvent) => void = function (event) { + // prevent search bar keybind + if ( + event.key === 'F3' || + (event.ctrlKey && event.key === 'f') || + (event.metaKey && event.key === 'f') + ) { + event.preventDefault(); + } }; window.addEventListener('keydown', onKeydown);