fix(input): don't submit on Enter during IME composition#446
Open
dim0627 wants to merge 1 commit into
Open
Conversation
Enter pressed to confirm an IME (Japanese/CJK) conversion candidate was being treated as 'send', submitting half-converted text and making the app unusable for IME input. Guard the Enter-to-submit handlers with isComposing (and keyCode 229 as a fallback) across all prompt inputs: TaskInput, AgentPane FollowUpInput, Pill, and LogsApp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pressing Enter to confirm an IME conversion (Japanese/CJK) was being treated as "send", submitting half-converted text and making the app unusable for IME input.
Fix
Guard the Enter-to-submit handlers with
!e.nativeEvent.isComposing && e.keyCode !== 229across all prompt inputs:TaskInput.tsxAgentPane.tsx(FollowUpInput)Pill.tsxLogsApp.tsxisComposingis the standard signal;keyCode === 229covers IMEs/browsers that fire a synthetic key during composition.ChatTurn.tsxuses Cmd/Ctrl+Enter and is unaffected.Test plan
Closes #445
Summary by cubic
Stop submitting on Enter during IME composition so conversion confirms without sending. Fixes #445.
!e.nativeEvent.isComposing && e.keyCode !== 229.Written for commit e25a8b0. Summary will update on new commits.