Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 13, 2023
1 parent 9692638 commit 89e955b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/util/highlightById.ts
Expand Up @@ -44,8 +44,8 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
const cursorTop = getSelectionPosition(editorElement).top - editorElement.getBoundingClientRect().top;
if (cursorTop < 0) {
editorElement.scrollTop = editorElement.scrollTop + cursorTop;
} else if (cursorTop > editorElement.clientHeight - 34) {
editorElement.scrollTop = editorElement.scrollTop + (cursorTop + 34 - editorElement.clientHeight);
} else if (cursorTop > editorElement.clientHeight - 74) { // 74 = 移动端底部 + 段落块高度
editorElement.scrollTop = editorElement.scrollTop + (cursorTop + 74 - editorElement.clientHeight);
}
return;
}
Expand Down

0 comments on commit 89e955b

Please sign in to comment.