Skip to content

Fix IME composition Enter key triggering message send#44

Open
JasprW wants to merge 1 commit intolcoutodemos:mainfrom
JasprW:fix/ime-composition-enter
Open

Fix IME composition Enter key triggering message send#44
JasprW wants to merge 1 commit intolcoutodemos:mainfrom
JasprW:fix/ime-composition-enter

Conversation

@JasprW
Copy link
Copy Markdown

@JasprW JasprW commented Mar 23, 2026

Summary

  • Fix bug where pressing Enter to confirm IME candidate (e.g. Chinese pinyin) incorrectly triggers message send
  • Add isComposing check to the keydown handler to skip send during active IME composition

Changes

src/renderer/components/InputBar.tsx — single line change:

- if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); handleSend() }
+ if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) { e.preventDefault(); handleSend() }

Test plan

  • Use Chinese (pinyin), Japanese, or Korean IME — pressing Enter to select a candidate should NOT send the message
  • After IME composition is confirmed, pressing Enter should send the message normally
  • Normal English typing + Enter still sends as expected

🤖 Generated with Claude Code

When using Chinese/Japanese/Korean input methods, pressing Enter to confirm
a candidate word would incorrectly trigger message send. Add isComposing
check to prevent send during active IME composition.

Shift+Enter line break already works via the existing !e.shiftKey guard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JasprW JasprW force-pushed the fix/ime-composition-enter branch from 09c2bfe to 081d4b4 Compare March 23, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant