Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: update editor's font size dynamically when default font size setting changes (#10047)

01zulfi1aa73c1f2374
diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx
index c2ccd6a65..d4b72db17 100644
--- a/apps/web/src/components/editor/tiptap.tsx
+++ b/apps/web/src/components/editor/tiptap.tsx
@@ -684,6 +684,12 @@ function TiptapWrapper(
}
}, [props.spellcheck]);
+ useEffect(() => {
+ if (editorContainerRef.current) {
+ editorContainerRef.current.style.fontSize = `${editorConfig.fontSize}px`;
+ }
+ }, [editorConfig.fontSize]);
+
return (
<Flex
ref={containerRef}