From 66aa94568ebac14f3b6ca4b342db7d6698d7b2e0 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 7 Feb 2026 00:45:11 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=8D=95=E5=85=83=E6=A0=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel <845765@qq.com> --- app/src/protyle/render/av/cell.ts | 11 ++++++++++- app/src/protyle/ui/initUI.ts | 6 +----- 2 files changed, 11 insertions(+), 6 deletions(-) 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);