Vanessa 2025-11-19 19:56:13 +08:00
parent f2d99e0867
commit d615ddaa97

View file

@ -143,7 +143,7 @@ export const keymap = {
<div class="fn__space"></div>
<label class="b3-form__icon fn__block searchByKeyLabel">
<svg class="b3-form__icon-icon"><use xlink:href="#iconKeymap"></use></svg>
<input id="searchByKey" data-value="" class="b3-form__icon-input b3-text-field fn__block" spellcheck="false" placeholder="${window.siyuan.languages.keymap}">
<input id="searchByKey" data-keymap="" class="b3-form__icon-input b3-text-field fn__block" spellcheck="false" placeholder="${window.siyuan.languages.keymap}">
</label>
<div class="fn__space"></div>
<button id="clearSearchBtn" class="b3-button b3-button--outline fn__flex-center fn__size200">
@ -337,13 +337,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.dataset.value);
keymap.search(searchElement.value, searchKeymapElement.dataset.keymap);
});
searchElement.addEventListener("input", (event: InputEvent) => {
if (event.isComposing) {
return;
}
keymap.search(searchElement.value, searchKeymapElement.dataset.value);
keymap.search(searchElement.value, searchKeymapElement.dataset.keymap);
});
/// #if !BROWSER
searchKeymapElement.addEventListener("focus", () => {