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();