From bf92fa3386be331871963f99ec5c813186a388b3 Mon Sep 17 00:00:00 2001 From: kamtschatka Date: Mon, 1 Jul 2024 22:00:47 +0200 Subject: [PATCH] fix: fixed an issue that would half the textarea in grid layout after submitting a bookmark (#269) --- apps/web/components/dashboard/bookmarks/EditorCard.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsx index 78bd0742..605fcf42 100644 --- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx +++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx @@ -33,6 +33,7 @@ function useFocusOnKeyPress(inputRef: React.RefObject) { inputRef.current.focus(); } } + document.addEventListener("keydown", handleKeyPress); return () => { document.removeEventListener("keydown", handleKeyPress); @@ -75,7 +76,8 @@ export default function EditorCard({ className }: { className?: string }) { }); } form.reset(); - if (inputRef?.current?.style) { + // if the list layout is used, we reset the size of the editor card to the original size after submitting + if (bookmarkLayout === "list" && inputRef?.current?.style) { inputRef.current.style.height = "auto"; } },