From 55b8707f9d43b2b1a214daedc731aa1f2414cfe2 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Thu, 5 Feb 2026 22:45:38 +0800 Subject: [PATCH] :art: Improve soft keyboard toolbar pop-up https://github.com/siyuan-note/siyuan/issues/16548 Signed-off-by: Daniel <845765@qq.com> --- app/src/mobile/util/keyboardToolbar.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts index 587b1f428..af9e9b0b1 100644 --- a/app/src/mobile/util/keyboardToolbar.ts +++ b/app/src/mobile/util/keyboardToolbar.ts @@ -609,12 +609,12 @@ export const initKeyboardToolbar = () => { if (type === "done") { if (toolbarElement.clientHeight > 100) { hideKeyboardToolbarUtil(); - focusByRange(range); if (window.JSAndroid && window.JSAndroid.showKeyboard) { window.JSAndroid.showKeyboard(); } else if (window.JSHarmony && window.JSHarmony.showKeyboard) { window.JSHarmony.showKeyboard(); } + setTimeout(() => focusByRange(range), 256); } else { activeBlur(); } @@ -696,7 +696,12 @@ export const initKeyboardToolbar = () => { } else if (type === "add") { if (buttonElement.classList.contains("protyle-toolbar__item--current")) { hideKeyboardToolbarUtil(); - focusByRange(range); + if (window.JSAndroid && window.JSAndroid.showKeyboard) { + window.JSAndroid.showKeyboard(); + } else if (window.JSHarmony && window.JSHarmony.showKeyboard) { + window.JSHarmony.showKeyboard(); + } + setTimeout(() => focusByRange(range), 256); } else { (document.activeElement as HTMLElement)?.blur(); buttonElement.classList.add("protyle-toolbar__item--current");