From ae95b564657640eccd40647ee00ebf99dc0c0eaa Mon Sep 17 00:00:00 2001 From: chiguyong Date: Thu, 11 Jun 2026 20:43:38 +0800 Subject: [PATCH] fix: use e.isComposing for IME detection instead of manual flag e.isComposing is a standard KeyboardEvent property that's true during IME composition. More reliable than compositionstart/compositionend which can fire at unpredictable timing relative to keydown. --- src/agentkit/server/static/index.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/agentkit/server/static/index.html b/src/agentkit/server/static/index.html index a1f84a6..0267cd5 100644 --- a/src/agentkit/server/static/index.html +++ b/src/agentkit/server/static/index.html @@ -211,7 +211,7 @@ html,body{height:100%;font-family:var(--font);background:var(--bg);color:var(--t
- +
@@ -466,10 +466,9 @@ async function sendMessage() { updateSendBtn(); } -let inputComposing = false; - function handleKey(e) { - if (e.key === 'Enter' && !e.shiftKey && !inputComposing) { + // e.isComposing is true during IME composition — don't submit then + if (e.key === 'Enter' && !e.shiftKey && !e.isComposing) { e.preventDefault(); sendMessage(); }