Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve soft keyboard toolbar pop-up https://github.com/siyuan-note/siyuan/issues/16548

Daniel55b8707f9d43
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 587b1f4281..af9e9b0b16 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");