Skip to content

Commit

Permalink
fix: while only a single code block, the synchronization scrolling fu…
Browse files Browse the repository at this point in the history
…nction is abnormal
  • Loading branch information
imzbf committed May 21, 2024
1 parent 0c3cf03 commit b41baed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/MdEditor/utils/scroll-auto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b41baed

Please sign in to comment.