Skip to content

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

:bug: Fix mobile block menu delay and keyboard dismissal https://github.com/siyuan-note/siyuan/issues/19409

Daniel210605becb15
diff --git a/app/src/menus/Menu.ts b/app/src/menus/Menu.ts
index 0dc12cd426..7c19d2ea12 100644
--- a/app/src/menus/Menu.ts
+++ b/app/src/menus/Menu.ts
@@ -11,6 +11,7 @@ import {electronUndo} from "../protyle/undo";
import {escapeAttr} from "../util/escape";
import {setMenuInputCurrent} from "./menuKeyboard";
import {forEachPluginSubscriber} from "../plugin/EventBusCore";
+import {activeBlur} from "../mobile/util/keyboardToolbar";
/// #if !MOBILE
import {applyMenuEntryVisibility} from "../config/entryVisibility/runtime";
/// #endif
@@ -73,7 +74,7 @@ export class Menu {
const name = this.element.getAttribute("data-name");
if ((name === Constants.MENU_BLOCK_SINGLE || name === Constants.MENU_BLOCK_MULTI) &&
!(event.target as Element).closest("input, textarea, select, [contenteditable=\"true\"]")) {
- // 保留编辑器选区和键盘,同时允许菜单输入框正常获取焦点。
+ // 保留编辑器选区,同时允许菜单输入框正常获取焦点。
event.preventDefault();
}
};
@@ -637,6 +638,8 @@ export class Menu {
this.element.lastElementChild.scrollTop = 0;
return;
}
+ // 主动打开菜单时跳过键盘弹出保护锁,收起键盘后再展开面板。
+ activeBlur(true);
clearTimeout(fullscreenCloseTimeout);
this.element.querySelectorAll(":scope > .b3-menu__items, .b3-menu__submenu > .b3-menu__items")
.forEach(updateMenuItemGroupClasses);