Skip to content

Pressing Enter to confirm IME candidate word on macOS triggers message send simultaneously #524

@muamiao

Description

@muamiao

Pre-checks

Deployment Method

Docker

Steps to Reproduce

  1. Open any conversation window
  2. Switch to a Chinese input method (e.g., Simplified Pinyin)
  3. Type pinyin to bring up the candidate word panel
  4. Press Enter to select a candidate word
  5. The message is sent immediately instead of only confirming the input

Expected vs Actual Behavior

  1. Pressing Enter should only commit the IME composition (candidate word selection), not trigger message send
  2. Message sending should be triggered by a dedicated shortcut (e.g., Cmd+Enter) or only when the user is not in an IME composition state

Logs / Screenshots

Environment

  1. OS: macOS (Sonoma / Sequoia)
  2. Input Method: macOS Built-in Simplified Pinyin / Sogou Pinyin / Other third-party Chinese IMEs
  3. Reproduce Rate: 100%

Actual Behavior

  1. The Enter key performs two actions simultaneously: confirming the candidate word AND sending the message
  2. Users cannot freely edit content while using a Chinese IME — every time they want to type English characters, they must manually switch to an English input method first

Impact

  1. Severely degrades the daily input experience for Chinese-speaking users
  2. Forces users to frequently switch between Chinese and English IMEs, adding unnecessary friction
  3. Particularly painful for scenarios requiring mixed Chinese-English input (e.g., technical discussions)

Suggested Fix

  1. Check KeyboardEvent.isComposing in the keydown event handler and skip the send logic when the value is true
  2. Alternatively, change the send shortcut to Cmd+Enter / Ctrl+Enter, and reserve Enter for line breaks and IME confirmation only

Reference

  1. MDN: KeyboardEvent.isComposing — https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing
  2. Major products such as Slack, Feishu (Lark), and Notion have all addressed this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions