修复回车bug

This commit is contained in:
luke 2025-06-01 16:56:13 +08:00
parent b5a15d0750
commit 5d879e490f

View File

@ -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 = () => {