diff --git a/app/src/mobile/util/keyboardToolbar.ts b/app/src/mobile/util/keyboardToolbar.ts
index 43eeaad3b..707af3a90 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 `
+ return `
`;
+`;
};
export const renderTextMenu = (protyle: IProtyle, toolbarElement: Element) => {
@@ -500,9 +500,9 @@ export const initKeyboardToolbar = () => {
`;
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 会改变