From 5ecd8b76a6f0132d3f8045cece37ea2778e79983 Mon Sep 17 00:00:00 2001 From: Frant1cc <1927468207@qq.com> Date: Sun, 25 Jan 2026 19:00:30 +0800 Subject: [PATCH] fix:CoWriterEditor scroll sync --- web/components/CoWriterEditor.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/web/components/CoWriterEditor.tsx b/web/components/CoWriterEditor.tsx index a563197f9..287c831ed 100644 --- a/web/components/CoWriterEditor.tsx +++ b/web/components/CoWriterEditor.tsx @@ -341,7 +341,7 @@ export default function CoWriterEditor({ // Synchronized scroll functionality const handleEditorScroll = useCallback(() => { if (isSyncingScroll.current) return; - const editor = editorContainerRef.current; + const editor = textareaRef.current; const preview = previewRef.current; if (!editor || !preview) return; @@ -358,7 +358,7 @@ export default function CoWriterEditor({ const handlePreviewScroll = useCallback(() => { if (isSyncingScroll.current) return; - const editor = editorContainerRef.current; + const editor = textareaRef.current; const preview = previewRef.current; if (!editor || !preview) return; @@ -1477,19 +1477,16 @@ export default function CoWriterEditor({ {content.length} chars ยท {content.split("\n").length} lines -