From b41baedb17c571e9ca7f08e62377d12f8b1ff3b7 Mon Sep 17 00:00:00 2001 From: zbf Date: Tue, 21 May 2024 09:29:47 +0800 Subject: [PATCH] fix: while only a single code block, the synchronization scrolling function is abnormal --- packages/MdEditor/utils/scroll-auto.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/MdEditor/utils/scroll-auto.ts b/packages/MdEditor/utils/scroll-auto.ts index 2bbbfcb6..cb344365 100644 --- a/packages/MdEditor/utils/scroll-auto.ts +++ b/packages/MdEditor/utils/scroll-auto.ts @@ -197,7 +197,7 @@ const scrollAuto = (pEle: HTMLElement, cEle: HTMLElement, codeMirrorUt: CodeMirr // 如果结束块已经在滚动到底部时的可视区了,那么就将当前块到末尾视为一个整体 // 达到左侧滚动到底部时,右侧同步滚动到底部的目标 - if (endLinePosition > scrollDOM.scrollHeight - scrollDOM.clientHeight) { + if (endLinePosition >= scrollDOM.scrollHeight - scrollDOM.clientHeight) { scale = (scrollDOM.scrollTop - startTop) / (scrollDOM.scrollHeight - scrollDOM.clientHeight - startTop);