From 9e2b4d08096b54d0ee4bd1caca1045b329d5bcdd Mon Sep 17 00:00:00 2001 From: fusawayugo Date: Wed, 25 Dec 2024 16:29:36 +0900 Subject: [PATCH 1/4] Lock height of markdown field --- optuna_dashboard/ts/components/Note.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/optuna_dashboard/ts/components/Note.tsx b/optuna_dashboard/ts/components/Note.tsx index 2f5e6f83e..c32ad23ff 100644 --- a/optuna_dashboard/ts/components/Note.tsx +++ b/optuna_dashboard/ts/components/Note.tsx @@ -272,7 +272,7 @@ const MarkdownEditorModal: FC<{ bottom: 0, height: "100%", left: 0, - overflow: "hidden", + overflow: "scroll", position: "fixed", right: 0, top: 0, @@ -316,6 +316,7 @@ const MarkdownEditorModal: FC<{ component="div" sx={{ width: "100%", + height: "calc(100% - 100px)", flexGrow: 1, display: preview ? "none" : "flex", flexDirection: "row", From c8b4ef39aad4e35e8cded3e26cd9a26c53075ba7 Mon Sep 17 00:00:00 2001 From: fusawayugo Date: Wed, 8 Jan 2025 15:01:23 +0900 Subject: [PATCH 2/4] Remove inputProps and fix the position of textarea --- optuna_dashboard/ts/components/Note.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/optuna_dashboard/ts/components/Note.tsx b/optuna_dashboard/ts/components/Note.tsx index c32ad23ff..5d446cccc 100644 --- a/optuna_dashboard/ts/components/Note.tsx +++ b/optuna_dashboard/ts/components/Note.tsx @@ -316,7 +316,6 @@ const MarkdownEditorModal: FC<{ component="div" sx={{ width: "100%", - height: "calc(100% - 100px)", flexGrow: 1, display: preview ? "none" : "flex", flexDirection: "row", @@ -332,10 +331,7 @@ const MarkdownEditorModal: FC<{ resize: "none", width: "100%", height: "100%", - "& .MuiInputBase-root": { height: "100%" }, - }} - inputProps={{ - style: { resize: "none", overflow: "scroll", height: "100%" }, + "& .MuiInputBase-root": { height: "100%", alignItems: "start" }, }} inputRef={textAreaRef} defaultValue={latestNote.body} From 1465d94d2887de655e9d68e852bd7d14b25102b7 Mon Sep 17 00:00:00 2001 From: fusawayugo Date: Wed, 8 Jan 2025 15:05:55 +0900 Subject: [PATCH 3/4] Minor fix --- optuna_dashboard/ts/components/Note.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/optuna_dashboard/ts/components/Note.tsx b/optuna_dashboard/ts/components/Note.tsx index 5d446cccc..eb8ec0897 100644 --- a/optuna_dashboard/ts/components/Note.tsx +++ b/optuna_dashboard/ts/components/Note.tsx @@ -331,7 +331,10 @@ const MarkdownEditorModal: FC<{ resize: "none", width: "100%", height: "100%", - "& .MuiInputBase-root": { height: "100%", alignItems: "start" }, + "& .MuiInputBase-root": { + height: "100%", + alignItems: "start" + }, }} inputRef={textAreaRef} defaultValue={latestNote.body} From b9b404b3e32637c20466599c4a7df29a40c6baf8 Mon Sep 17 00:00:00 2001 From: fusawayugo Date: Wed, 8 Jan 2025 15:06:39 +0900 Subject: [PATCH 4/4] apply formatter --- optuna_dashboard/ts/components/Note.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/optuna_dashboard/ts/components/Note.tsx b/optuna_dashboard/ts/components/Note.tsx index eb8ec0897..5d905101f 100644 --- a/optuna_dashboard/ts/components/Note.tsx +++ b/optuna_dashboard/ts/components/Note.tsx @@ -331,9 +331,9 @@ const MarkdownEditorModal: FC<{ resize: "none", width: "100%", height: "100%", - "& .MuiInputBase-root": { - height: "100%", - alignItems: "start" + "& .MuiInputBase-root": { + height: "100%", + alignItems: "start", }, }} inputRef={textAreaRef}