v1.6.2: fix RichEditor auto-scroll and PDF offers multi-page header

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-05-09 20:23:36 +02:00
parent e4f14a24b7
commit 59b478f262
3 changed files with 12 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
import { useMemo, useRef, useCallback, useEffect } from "react";
import { useMemo, useRef, useCallback, useLayoutEffect } from "react";
import ReactQuill from "react-quill-new";
import "react-quill-new/dist/quill.snow.css";
@@ -96,11 +96,14 @@ export default function RichEditor({
[onChange],
);
useEffect(() => {
useLayoutEffect(() => {
if (!quillRef.current) return;
const editor = quillRef.current.getEditor();
editor.format("font", "tahoma");
editor.format("size", "14px");
// Quill auto-focuses on mount with existing content, which scrolls
// the page to the editor. Blur to prevent unwanted scroll.
editor.blur();
}, []);
return (