Skip to content

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

:bug: Keep mobile text action toolbar open when switching actions https://github.com/siyuan-note/siyuan/issues/18867

Daniel6d129824ba15
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index e377e0c4e7..46e0728f1c 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -2122,6 +2122,12 @@ export class Toolbar {
html += '<button class="keyboard__action" data-action="more"><svg><use xlink:href="#iconMore"></use></svg></button>';
}
this.subElement.innerHTML = `<div class="fn__flex">${html}</div>`;
+ this.subElement.lastElementChild.addEventListener("pointerdown", (event) => {
+ if (hasClosestByClassName(event.target as HTMLElement, "keyboard__action")) {
+ // 避免操作按钮获取焦点导致编辑器失焦和软键盘收起。
+ event.preventDefault();
+ }
+ });
this.subElement.lastElementChild.addEventListener("click", async (event) => {
const btnElemen = hasClosestByClassName(event.target as HTMLElement, "keyboard__action");
if (!btnElemen) {