From 66d09019387073c18b026c05aa5df676cb2f2fc0 Mon Sep 17 00:00:00 2001 From: chiguyong Date: Thu, 11 Jun 2026 15:37:06 +0800 Subject: [PATCH] fix: prevent Enter from submitting during IME composition Added compositionstart/compositionend event listeners to track IME composing state. Enter key now only submits when not composing, so Chinese/Japanese/Korean input methods work correctly. --- src/agentkit/server/static/index.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/agentkit/server/static/index.html b/src/agentkit/server/static/index.html index d94306d..a1f84a6 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,8 +466,10 @@ async function sendMessage() { updateSendBtn(); } +let inputComposing = false; + function handleKey(e) { - if (e.key === 'Enter' && !e.shiftKey) { + if (e.key === 'Enter' && !e.shiftKey && !inputComposing) { e.preventDefault(); sendMessage(); }