Skip to content

fix: prevent Enter key during IME composition from triggering execution#490

Closed
liuxiaopai-ai wants to merge 1 commit intodifferent-ai:devfrom
liuxiaopai-ai:fix/ime-composition-enter
Closed

fix: prevent Enter key during IME composition from triggering execution#490
liuxiaopai-ai wants to merge 1 commit intodifferent-ai:devfrom
liuxiaopai-ai:fix/ime-composition-enter

Conversation

@liuxiaopai-ai
Copy link

Summary

Fixes #442

When using an IME (e.g. Japanese, Chinese, Korean input methods), pressing Enter to confirm character conversion was incorrectly triggering form submissions, message sends, and other actions. This happened because the keydown handlers did not check the event.isComposing property or the legacy event.keyCode === 229 indicator.

Changes

Added if (event.isComposing || event.keyCode === 229) return; guard to all Enter key handlers across 10 files:

  • composer.tsx — Main chat input (message send, mention select, slash command select). Consolidated the existing partial guard into a single early-return at the top of the keydown handler.
  • model-picker-modal.tsx — Model selection on Enter
  • question-modal.tsx — Option selection and custom input submission (2 handlers)
  • rename-session-modal.tsx — Session rename on Enter
  • rename-workspace-modal.tsx — Workspace rename on Enter
  • dashboard.tsx — Keyboard-accessible workspace/session list items (3 handlers)
  • session.tsx — Keyboard-accessible workspace/session list items (3 handlers)
  • proto-v1-ux.tsx — Expandable section toggle
  • skills.tsx — Skill card activation
  • onboarding.tsx — Directory path input submission

Why both checks?

  • event.isComposing — The standard W3C property indicating active IME composition
  • event.keyCode === 229 — Legacy fallback for older browsers and some Android IMEs that don't set isComposing correctly

Testing

  • No unit test framework (vitest/jest) is configured for the frontend app package
  • Manual testing recommended with Japanese/Chinese/Korean IME input

@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-software Ready Ready Preview, Comment Feb 7, 2026 10:47am

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2026

The following comment was made by an LLM, it may be inaccurate:

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.

[Bug]: 🐛 Japanese IME Enter key triggers unintended execution

2 participants