Skip to content

Fix: don't submit comment on IME composition Enter key - #30

Open
ulysses0604 wants to merge 1 commit into
petergyang:mainfrom
ulysses0604:fix/ime-composition-enter
Open

Fix: don't submit comment on IME composition Enter key#30
ulysses0604 wants to merge 1 commit into
petergyang:mainfrom
ulysses0604:fix/ime-composition-enter

Conversation

@ulysses0604

@ulysses0604 ulysses0604 commented Aug 15, 2026

Copy link
Copy Markdown

Problem

Every Enter-key handler that submits a comment treated a bare Enter as "submit," with no check for whether an IME composition was in progress. Japanese/CJK users pressing Enter to confirm kanji conversion had their in-progress comment submitted prematurely instead of just confirming the conversion.

This affected:

  • The comment composer (#composeText in chrome-client.js)
  • Inline comment editing (editComment in chrome-client.js)
  • The Cmd/Ctrl+Enter send-batch shortcut (chrome-client.js)
  • The artifact SDK's link-input Enter-to-apply handler (sdk.js)

Fix

Added a small isImeCommitEnter(event) guard (event.isComposing || event.keyCode === 229) before each handler's submit action, so a composition-confirming Enter no longer triggers preventDefault() or the submit action.

Testing

  • npm test — all existing tests pass, no regressions
  • Manually verified in a browser (Safari): typing Japanese text and confirming kanji conversion with Enter no longer submits the comment; a normal Enter still submits as before

Every Enter-key keydown handler that submits a comment (the comment
composer, inline comment editing, the send-batch shortcut, and the
artifact SDK's link-input) treated a bare Enter as "submit" without
checking whether an IME composition was in progress. Japanese/CJK
users pressing Enter to confirm kanji conversion had their in-progress
comment submitted prematurely instead.

Add an isImeCommitEnter(event) guard (event.isComposing, with the
legacy keyCode === 229 fallback) before each of these handlers acts,
so a composition-confirming Enter no longer triggers preventDefault()
or the submit action.
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.

1 participant