Vanessa 2022-10-07 20:08:39 +08:00
parent df298125ec
commit e0be2e345a
2 changed files with 10 additions and 5 deletions

View file

@ -44,10 +44,10 @@ export const scrollCenter = (protyle: IProtyle, nodeElement?: Element, top = fal
const cursorTop = getSelectionPosition(editorElement).top - editorElement.getBoundingClientRect().top;
if (offset) { // 仅移动端弹起键盘用到
editorElement.scroll({
top: editorElement.scrollLeft,
left: editorElement.scrollTop + cursorTop - offset,
top: editorElement.scrollTop + cursorTop - offset,
left: editorElement.scrollLeft,
behavior: "smooth"
})
});
return;
}
if (cursorTop < 0) {