From 5d879e490f16229619eba2c1721a66975034b14d Mon Sep 17 00:00:00 2001 From: luke Date: Sun, 1 Jun 2025 16:56:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E8=BD=A6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/popup.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/popup.js b/scripts/popup.js index a912fce..9ed6649 100644 --- a/scripts/popup.js +++ b/scripts/popup.js @@ -260,7 +260,7 @@ document.addEventListener("DOMContentLoaded", async () => { }); input.addEventListener("keydown", e => { if (e.key === "Enter") { - log("按下回车键"); + e.preventDefault(); triggerSearch(); } }); @@ -301,8 +301,11 @@ document.addEventListener("DOMContentLoaded", async () => { fetchLLMAnswer(val, llmResultContainer, llmResultContent); }); - llmInput.addEventListener("keydown", (e) => { - if (e.key === "Enter") llmSendBtn.click(); + llmInput.addEventListener("keydown", e => { + if (e.key === "Enter") { + e.preventDefault(); + document.getElementById("llmSendBtn").click(); + } }); openTabBtn.onclick = () => {