Fix Enter during IME composition sending the message - #73
Conversation
When typing with an IME (Japanese, Chinese, Korean), pressing Enter to confirm a conversion was treated as a send/submit. Guard the keydown handlers of the chat input, chat list rename input, and chat title input with isComposing (plus keyCode 229 for browsers that fire the confirming keydown without isComposing set). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
After opening this I noticed #31 addresses the same IME composition bug in the chat composer and was submitted first — apologies for the overlap. For the maintainers, the differences in this PR:
Happy to defer to #31 and close this one if you'd prefer to land that first — either way, whichever base you pick, the 229 fallback and the two extra inputs are probably worth including. Your call. |
|
I have read the CLA Document and I hereby sign the CLA |
|
/bonk review this |
|
Hi @kote2kote, Apologies but, per our contributing guide, we prefer not to receive external pull requests. We prefer instead to receive issue reports, which we can then direct our own agents to solve. Could you please file an issue instead? |
Problem
When typing with an IME (Japanese, Chinese, Korean input methods), pressing Enter to confirm a text conversion is interpreted as a send action. This makes the chat input nearly unusable for CJK users: every conversion confirmation sends a half-written message.
Fix
Guard the
onKeyDownhandlers with the standard IME check:keyCode === 229covers browsers (notably Safari) that fire the confirming keydown withoutisComposingset.Applied to the three text inputs in
ChatInterface.tsxthat submit on Enter:Testing
tsc --noEmitpasses inpackages/workshop-frontend.🤖 Generated with Claude Code