Skip to content

IME composition conflicts with Enter key to send messages on macOS #6

@ewfian

Description

@ewfian

On macOS, when using Chinese input method (or other IME), pressing Enter to confirm English input incorrectly triggers message sending instead of completing the IME composition.

Steps to Reproduce (macOS)

  1. Switch to Chinese input method on macOS
  2. Start typing an English word in the chat input (e.g., "pointer")
  3. Press Enter to confirm the English input
  4. Expected: Input method confirms and inserts "pointer"
  5. Actual: Message is sent prematurely before finishing the sentence

Example Scenario

When typing "介绍一下pointer是什么":

  • Type "介绍一下pointer"
  • Press Enter to confirm "pointer"
  • Message sends immediately with incomplete text, missing "是什么"

Expected Behavior

  • Enter key should complete IME composition first
  • Message should only be sent when Enter is pressed outside of IME composition state

Current Behavior

The input field's onKeyDown handler doesn't check for IME composition state, causing Enter key events to trigger onSend() even during active composition.

Environment

  • Platform: macOS (also affects other platforms with IME support)
  • Input Method: Chinese, Japanese

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions