diff --git a/webui/src/components/Editor.tsx b/webui/src/components/Editor.tsx index 1399b96..2566079 100644 --- a/webui/src/components/Editor.tsx +++ b/webui/src/components/Editor.tsx @@ -47,10 +47,11 @@ interface EditorProps { initialValue?: string; onChange?: (editor: any, changes: any) => void; onReady?: (editor: any) => void; + fontSize?: number; } export const Editor = forwardRef(function Editor( - { initialValue = "", onChange, onReady }, + { initialValue = "", onChange, onReady, fontSize = 14 }, ref ) { const textareaRef = useRef(null); @@ -113,6 +114,17 @@ export const Editor = forwardRef(function Editor( }; }, []); // DO NOT FILL ARRAY + // Update font size when it changes + useEffect(() => { + if (editorRef.current) { + const wrapper = editorRef.current.getWrapperElement(); + if (wrapper) { + wrapper.style.fontSize = `${fontSize}px`; + editorRef.current.refresh(); + } + } + }, [fontSize]); + return (