diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 7330ee22f..027d62045 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -418,7 +418,16 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme /// #if MOBILE const contentElement = hasClosestByClassName(blockElement, "protyle-content", true); if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") { - const keyboardToolbarTop = (window.siyuan.mobile.size.isLandscape ? window.siyuan.mobile.size.landscape.height2 : window.siyuan.mobile.size.portrait.height2) - 48; + let keyboardToolbarTop = window.innerHeight / 2 - 48; + if (window.siyuan.mobile.size.isLandscape) { + if (window.siyuan.mobile.size.landscape.height1 !== window.siyuan.mobile.size.landscape.height2) { + keyboardToolbarTop = window.siyuan.mobile.size.landscape.height2 - 48; + } + } else { + if (window.siyuan.mobile.size.portrait.height1 !== window.siyuan.mobile.size.portrait.height2) { + keyboardToolbarTop = window.siyuan.mobile.size.portrait.height2 - 48; + } + } if (cellRect.bottom > keyboardToolbarTop) { contentElement.scrollTop = contentElement.scrollTop + (cellRect.bottom - keyboardToolbarTop); } else if (cellRect.top < 110) { diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 684c5afc2..8c03024cd 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -333,11 +333,7 @@ export const getPadding = (protyle: IProtyle) => { let left = 24; let bottom = 16; if (protyle.options.typewriterMode) { - if (isMobile()) { - bottom = window.innerHeight / 5; - } else { - bottom = protyle.element.clientHeight / 2; - } + bottom = protyle.element.clientHeight / 2; } if (!isMobile()) { let isFullWidth = protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_FULLWIDTH);