There’s a bug when using a Chinese Input Method Editor (IME) to type English characters (e.g., typing words without switching the IME off). Normally, pressing Enter means “do not select any candidate and directly input the content in the buffer.” However, in the chat interface, this is interpreted as “send message,” causing this bug.
Expected Behavior:
- User types English letters using Chinese IME (e.g., typing “hello”)
- IME displays candidate word list
- User presses Enter, expecting to: confirm the original typed letters without selecting any candidates
Actual Behavior:
- Enter key is captured by the chat interface, directly triggering the “send message” function
- This causes the IME buffer content to be incorrectly sent, or sends an incomplete message
Root Cause:
This is a keyboard shortcut conflict between two levels:
- IME level: Enter = confirm current input (composition)
- Application level: Enter = send message
The chat application is not properly handling the IME’s “composition state,” causing it to intercept the Enter key event while the IME is still processing input.
This is a video demo/repro of the bug:
Every time I press Enter key, a new message has been sent.