Skip to content

fix(desktop): skip Enter submit when Chinese IME is composing - #38135

Closed
Eddie0521 wants to merge 1 commit into
NousResearch:mainfrom
Eddie0521:fix/desktop-ime-composing
Closed

fix(desktop): skip Enter submit when Chinese IME is composing#38135
Eddie0521 wants to merge 1 commit into
NousResearch:mainfrom
Eddie0521:fix/desktop-ime-composing

Conversation

@Eddie0521

Copy link
Copy Markdown

Problem

When using a Chinese input method (IME), pressing Enter to confirm the current composition candidate causes the message to be sent instead — the isComposing flag is not checked in the keydown handler.

Fix

Added event.nativeEvent.isComposing guard to both the trigger-popover Enter/Tab handler and the main Enter-to-submit handler in the contentEditable composer, so they return early during IME composition.

Testing

  • npm run type-check
  • npm run lint

The contentEditable keydown handler checked event.key === 'Enter' but
did not check event.nativeEvent.isComposing. When a Chinese IME user
presses Enter to confirm the current composition candidate, the browser
fires a keydown with isComposing=true; the handler treated it as submit
and sent the message before the IME could finish.

Add isComposing guards to both the trigger-popover Enter/Tab handler
and the main Enter-to-submit handler so they return early during IME
composition.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have duplicate This issue or pull request already exists labels Jun 3, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This overlaps a cluster of open PRs all fixing #37483 by guarding IME composition on Enter: #37996, #37487, #37757. Cross-linking so maintainers can pick one canonical fix.

@Morad37

Morad37 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Nice catch. The isComposing guard on the trigger-key handler (line 598) is the right layer -- no point processing trigger popups while the IME is still composing.

Related bug #38117 is about Korean input leaving the last syllable behind in the input. The same isComposing check would fix that too if the composer still processes keydown during composition on that path. Worth checking if Korean IME also sends composition events the same way.

@Eddie0521

Copy link
Copy Markdown
Author

it really make some confusion.
really appreciate it if you can fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants