mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 18:00:15 +01:00
This commit is contained in:
parent
9cae635647
commit
4bc21c493b
8 changed files with 12 additions and 13 deletions
|
|
@ -42,7 +42,7 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
|
|||
if (!top && getSelection().rangeCount > 0 && hasClosestBlock(getSelection().getRangeAt(0).startContainer)) {
|
||||
const editorElement = protyle.contentElement;
|
||||
const cursorTop = getSelectionPosition(editorElement).top - editorElement.getBoundingClientRect().top;
|
||||
let top = 0
|
||||
let top = 0;
|
||||
if (cursorTop < 0) {
|
||||
top = editorElement.scrollTop + cursorTop;
|
||||
} else if (cursorTop > editorElement.clientHeight - 74) { // 74 = 移动端底部 + 段落块高度
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue