diff --git a/src/components/forms/custom-form-builder.tsx b/src/components/forms/custom-form-builder.tsx index 815fc66..d9aec3c 100644 --- a/src/components/forms/custom-form-builder.tsx +++ b/src/components/forms/custom-form-builder.tsx @@ -227,6 +227,7 @@ export function CustomFormBuilder() { const [customDefs, setCustomDefs] = useState([]); const [fontFamily, setFontFamily] = useState("Bookman Old Style"); const [fontSize, setFontSize] = useState(12); + const [lineHeight, setLineHeight] = useState(1.5); // Template management const [templates, setTemplates] = useState([]); @@ -288,14 +289,14 @@ export function CustomFormBuilder() { setTemplates((data ?? []) as unknown as SavedTemplate[]); }; - // Apply font style to editor DOM + // Apply font style + line height to editor DOM useEffect(() => { if (!editor) return; const el = editor.view.dom as HTMLElement; el.style.fontFamily = `"${fontFamily}", Georgia, serif`; el.style.fontSize = `${fontSize}pt`; - el.style.lineHeight = "1.5"; - }, [editor, fontFamily, fontSize]); + el.style.lineHeight = String(lineHeight); + }, [editor, fontFamily, fontSize, lineHeight]); const insertVar = (key: string) => { if (!editor) return;