From 8abfeb1213b8738086c3885a82b7d346c7829df3 Mon Sep 17 00:00:00 2001 From: pompurin404 Date: Mon, 28 Oct 2024 11:04:52 +0800 Subject: [PATCH] fix editor size #282 --- src/renderer/src/components/base/base-editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/components/base/base-editor.tsx b/src/renderer/src/components/base/base-editor.tsx index 5b9e4c3..79c7160 100644 --- a/src/renderer/src/components/base/base-editor.tsx +++ b/src/renderer/src/components/base/base-editor.tsx @@ -105,7 +105,9 @@ export const BaseEditor: React.FC = (props) => { useEffect(() => { window.onresize = (): void => { - editorRef.current?.layout() + setTimeout(() => { + editorRef.current?.layout() + }, 0) } return (): void => { window.onresize = null