Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
7f7cc9fff7
commit
c76cb60ab5
@@ -227,6 +227,7 @@ export function CustomFormBuilder() {
|
||||
const [customDefs, setCustomDefs] = useState<CustomFieldVar[]>([]);
|
||||
const [fontFamily, setFontFamily] = useState("Bookman Old Style");
|
||||
const [fontSize, setFontSize] = useState(12);
|
||||
const [lineHeight, setLineHeight] = useState(1.5);
|
||||
|
||||
// Template management
|
||||
const [templates, setTemplates] = useState<SavedTemplate[]>([]);
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user