Skip to content

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

:art: https://github.com/siyuan-note/siyuan/issues/9320

Vanessa82bed847e6c3
diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 43eeaad3b4..707af3a908 100644
--- a/app/src/mobile/util/keyboardToolbar.ts
+++ b/app/src/mobile/util/keyboardToolbar.ts
@@ -21,10 +21,10 @@ const getSlashItem = (value: string, icon: string, text: string, focus = "false"
} else {
iconHTML = icon;
}
- return `<div class="keyboard__slash-item" data-focus="${focus}" data-value="${encodeURIComponent(value)}">
+ return `<button class="keyboard__slash-item" data-focus="${focus}" data-value="${encodeURIComponent(value)}">
${iconHTML}
<span class="keyboard__slash-text">${text}</span>
-</div>`;
+</button>`;
};
export const renderTextMenu = (protyle: IProtyle, toolbarElement: Element) => {
@@ -500,9 +500,9 @@ export const initKeyboardToolbar = () => {
</div>
<div class="keyboard__util"></div>`;
toolbarElement.addEventListener("click", (event) => {
+ const protyle = getCurrentEditor()?.protyle;
const target = event.target as HTMLElement;
const slashBtnElement = hasClosestByClassName(event.target as HTMLElement, "keyboard__slash-item");
- const protyle = getCurrentEditor()?.protyle;
if (slashBtnElement && !slashBtnElement.getAttribute("data-type")) {
const dataValue = decodeURIComponent(slashBtnElement.getAttribute("data-value"));
protyle.hint.fill(dataValue, protyle, false); // 点击后 range 会改变