aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkamtschatka <simon.schatka@gmx.at>2024-07-01 22:00:47 +0200
committerGitHub <noreply@github.com>2024-07-01 21:00:47 +0100
commitbf92fa3386be331871963f99ec5c813186a388b3 (patch)
tree1154552ca75e9ff15a1c63e27519ad1d512fe32f
parent4e70fe34742a5b4f505e61fcd236574dc5c3e265 (diff)
downloadkarakeep-bf92fa3386be331871963f99ec5c813186a388b3.tar.zst
fix: fixed an issue that would half the textarea in grid layout after submitting a bookmark (#269)
-rw-r--r--apps/web/components/dashboard/bookmarks/EditorCard.tsx4
1 files changed, 3 insertions, 1 deletions
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<HTMLTextAreaElement>) {
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";
}
},