From 6d206d48749221b5e3cc5d7ca82dc833b05ccbf0 Mon Sep 17 00:00:00 2001 From: Blinko Date: Sun, 1 Dec 2024 23:14:11 +0800 Subject: [PATCH] fix: editor ui height --- src/components/BlinkoEditor/index.tsx | 2 -- src/components/Common/Editor/index.tsx | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/BlinkoEditor/index.tsx b/src/components/BlinkoEditor/index.tsx index 71dc184..26cf8ff 100644 --- a/src/components/BlinkoEditor/index.tsx +++ b/src/components/BlinkoEditor/index.tsx @@ -28,7 +28,6 @@ export const BlinkoEditor = observer(({ mode, onSended, onHeightChange }: IProps originFiles={!isCreateMode ? blinko.curSelectedNote?.attachments : []} content={isCreateMode ? blinko.noteContent! : blinko.curSelectedNote?.content!} onChange={v => { - onHeightChange?.(editorRef.current?.clientHeight ?? 75) isCreateMode ? (blinko.noteContent = v) : (blinko.curSelectedNote!.content = v) }} onHeightChange={() => { @@ -39,7 +38,6 @@ export const BlinkoEditor = observer(({ mode, onSended, onHeightChange }: IProps isCreateMode ?
Drop to upload files
:
{dayjs(blinko.curSelectedNote!.createdAt).format("YYYY-MM-DD hh:mm:ss")}
} - onSend={async ({ files }) => { if (isCreateMode) { //@ts-ignore diff --git a/src/components/Common/Editor/index.tsx b/src/components/Common/Editor/index.tsx index 8d17271..6072760 100644 --- a/src/components/Common/Editor/index.tsx +++ b/src/components/Common/Editor/index.tsx @@ -323,6 +323,7 @@ const Editor = observer(({ content, onChange, onSend, isSendLoading, bottomSlot, useEffect(() => { store.updateSendStatus() setIsWriting(ai.isWriting) + onHeightChange?.() }, [blinko.noteTypeDefault, content, ai.isWriting, store.files?.length]) useEffect(() => {