Skip to content

Commit

Permalink
fix: fixed an issue that would half the textarea in grid layout after…
Browse files Browse the repository at this point in the history
… submitting a bookmark (#269)
  • Loading branch information
kamtschatka authored Jul 1, 2024
1 parent 4e70fe3 commit bf92fa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/components/dashboard/bookmarks/EditorCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function useFocusOnKeyPress(inputRef: React.RefObject<HTMLTextAreaElement>) {
inputRef.current.focus();
}
}

document.addEventListener("keydown", handleKeyPress);
return () => {
document.removeEventListener("keydown", handleKeyPress);
Expand Down Expand Up @@ -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";
}
},
Expand Down

0 comments on commit bf92fa3

Please sign in to comment.