Skip to content

Commit

Permalink
🎨 #9320
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 30, 2023
1 parent f8b272d commit 82bed84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/src/mobile/util/keyboardToolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 会改变
Expand Down

0 comments on commit 82bed84

Please sign in to comment.