From cbc268ef9e3a30127d148eccec5fe64367de4201 Mon Sep 17 00:00:00 2001
From: kamtschatka <simon.schatka@gmx.at>
Date: Sun, 20 Oct 2024 00:04:14 +0200
Subject: feature(web): Add keyboard shortcut to focus on search bar. Fixes
 #449 (#554)

added ctrl+k to focus the search bar
added escape to delete the input of the search bar
fixed behavior of ctrl+e on windows, which would otherwise focus the chrome searchbar
---
 apps/web/components/dashboard/bookmarks/EditorCard.tsx | 1 +
 1 file changed, 1 insertion(+)

(limited to 'apps/web/components/dashboard/bookmarks/EditorCard.tsx')

diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
index d1489b09..4d851d1c 100644
--- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
@@ -31,6 +31,7 @@ function useFocusOnKeyPress(inputRef: React.RefObject<HTMLTextAreaElement>) {
       }
       if ((e.metaKey || e.ctrlKey) && e.code === "KeyE") {
         inputRef.current.focus();
+        e.preventDefault();
       }
     }
 
-- 
cgit v1.2.3-70-g09d2

