From 7cbdb4e6e021a608f487f65301eb8295c3a291d8 Mon Sep 17 00:00:00 2001 From: shinchan-zhai Date: Sun, 22 Mar 2026 22:35:22 +0800 Subject: [PATCH] fix(nofxi): prevent IME composition enter from sending message --- nofxi/web/index.html | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/nofxi/web/index.html b/nofxi/web/index.html index 114eefa5..a34b1fb6 100644 --- a/nofxi/web/index.html +++ b/nofxi/web/index.html @@ -188,7 +188,7 @@
Thinking...
- +
Enter to send · /help, /analyze BTC, /buy ETH 0.1
@@ -399,6 +399,17 @@ async function loadChart(){ chTimer=setInterval(loadChart,30000); } +// IME composition guard +let composing = false; +inpEl.addEventListener('compositionstart', () => { composing = true; }); +inpEl.addEventListener('compositionend', () => { composing = false; }); +inpEl.addEventListener('keydown', (e) => { + if (e.key === 'Enter' && !e.shiftKey && !composing) { + e.preventDefault(); + send(); + } +}); + // Init applyLang(); inpEl.focus();