From 21077134ea14a29541308237bca876c4076b16ca Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 10 Jan 2024 09:55:16 +0800 Subject: [PATCH] :art: --- app/src/protyle/hint/index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/protyle/hint/index.ts b/app/src/protyle/hint/index.ts index 87905910c..03cfe0466 100644 --- a/app/src/protyle/hint/index.ts +++ b/app/src/protyle/hint/index.ts @@ -58,8 +58,7 @@ export class Hint { } const btnElement = hasClosestByMatchTag(eventTarget, "BUTTON"); if (btnElement && !btnElement.classList.contains("emojis__item") && !btnElement.classList.contains("emojis__type")) { - focusByRange(protyle.toolbar.range); - this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, true, this.source === "search" ? isNotCtrl(event) : isOnlyMeta(event)); + this.fill(decodeURIComponent(btnElement.getAttribute("data-value")), protyle, false, this.source === "search" ? isNotCtrl(event) : isOnlyMeta(event)); event.preventDefault(); event.stopPropagation(); // https://github.com/siyuan-note/siyuan/issues/3710 return; @@ -294,10 +293,7 @@ ${unicode2Emoji(emoji.unicode)}`; } upDownHint(this.element.lastElementChild, event); if (event.key === "Enter") { - setTimeout(() => { - this.fill(decodeURIComponent(this.element.querySelector(".b3-list-item--focus").getAttribute("data-value")), protyle, true, isNotCtrl(event)); - }, 148); // 划选引用点击,需先重置 range - focusByRange(protyle.toolbar.range); + this.fill(decodeURIComponent(this.element.querySelector(".b3-list-item--focus").getAttribute("data-value")), protyle, false, isNotCtrl(event)); event.preventDefault(); } else if (event.key === "Escape") { this.element.classList.add("fn__none");