From 56eeedc20a26a8f5842eb030b39d919b5608ff17 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 23 May 2024 17:14:52 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/11511 --- app/src/config/keymap.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts index ea94b2bfc..a4fcdbcc8 100644 --- a/app/src/config/keymap.ts +++ b/app/src/config/keymap.ts @@ -229,7 +229,7 @@ export const keymap = { keymap.element.querySelectorAll("#keymapList .b3-list-item--hide-action > .b3-list-item__text").forEach(item => { const liElement = item.parentElement; let matchedKeymap = false; - if (keymapString === "" || (liElement.querySelector(".b3-text-field") as HTMLInputElement).value.indexOf(updateHotkeyTip(keymapString)) > -1) { + if (keymapString === "" || liElement.querySelector(".b3-text-field").getAttribute("data-value").indexOf(keymapString) > -1) { matchedKeymap = true; } if ((item.textContent.toLowerCase().indexOf(value.toLowerCase()) > -1 || value.toLowerCase().indexOf(item.textContent.toLowerCase()) > -1 || value === "") && matchedKeymap) { @@ -298,13 +298,13 @@ export const keymap = { const searchElement = keymap.element.querySelector("#keymapInput") as HTMLInputElement; const searchKeymapElement = keymap.element.querySelector("#searchByKey") as HTMLInputElement; searchElement.addEventListener("compositionend", () => { - keymap.search(searchElement.value, searchKeymapElement.value); + keymap.search(searchElement.value, searchKeymapElement.dataset.value); }); searchElement.addEventListener("input", (event: InputEvent) => { if (event.isComposing) { return; } - keymap.search(searchElement.value, searchKeymapElement.value); + keymap.search(searchElement.value, searchKeymapElement.dataset.value); }); /// #if !BROWSER searchKeymapElement.addEventListener("focus", () => { @@ -325,6 +325,7 @@ export const keymap = { setTimeout(() => { this.value = updateHotkeyTip(keymapStr); }); + this.dataset.keymap = keymapStr; keymap.search(searchElement.value, keymapStr); }); keymap.element.querySelector("#clearSearchBtn").addEventListener("click", () => {