Skip to content

fix: ignore Enter keydown during IME composition for CJK input#50

Open
123outsider wants to merge 1 commit into
formulahendry:mainfrom
123outsider:main
Open

fix: ignore Enter keydown during IME composition for CJK input#50
123outsider wants to merge 1 commit into
formulahendry:mainfrom
123outsider:main

Conversation

@123outsider

Copy link
Copy Markdown

This pull request makes a small but important improvement to the chat input handling in ChatWebviewProvider.ts. It ensures that the Enter key only triggers actions when the user is not in the middle of composing text (such as when using an IME for non-Latin characters), preventing accidental submissions.

  • User input handling:
    • Updated Enter key event checks to include a condition for !e.isComposing, so actions are not triggered while the user is composing text with an IME. (src/ui/ChatWebviewProvider.ts) [1] [2]

Copilot AI review requested due to automatic review settings July 3, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves chat prompt input handling in ChatWebviewProvider.ts by preventing Enter key actions from firing while the user is composing text via an IME (common for CJK input), avoiding accidental submits/cancels during composition.

Changes:

  • Gate Enter-triggered actions behind !e.isComposing to ignore Enter while IME composition is active.
  • Apply the same composition guard both for slash-command popup selection and for the main send/cancel Enter handler.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants