From 24bdef92eab8a6d9aa66cafe2d4e58759373668d Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 17 Oct 2024 16:19:40 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/12816 --- app/src/boot/globalEvent/command/panel.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/boot/globalEvent/command/panel.ts b/app/src/boot/globalEvent/command/panel.ts index 16e76d0ac..fb866502f 100644 --- a/app/src/boot/globalEvent/command/panel.ts +++ b/app/src/boot/globalEvent/command/panel.ts @@ -77,16 +77,17 @@ export const commandPanel = (app: App) => { plugin.commands.forEach(command => { const liElement = document.createElement("li"); liElement.classList.add("b3-list-item"); - liElement.dataset.command = command.langKey; liElement.innerHTML = `${plugin.displayName}: ${command.langText || plugin.i18n[command.langKey]} ${updateHotkeyTip(command.customHotkey)}`; - liElement.addEventListener("click", () => { + liElement.addEventListener("click", (event) => { if (command.callback) { command.callback(); } else if (command.globalCallback) { command.globalCallback(); } dialog.destroy(); + event.preventDefault(); + event.stopPropagation(); }); listElement.insertAdjacentElement("beforeend", liElement); });