fix(desktop): block Enter keyCode 229 after IME compositionend - #41026
Closed
leeclouddragon wants to merge 1 commit into
Closed
leeclouddragon wants to merge 1 commit into
leeclouddragon wants to merge 1 commit into
Conversation
macOS Chinese IME (and some 3rd-party Windows IMEs) emit Enter with keyCode 229 (legacy VK_PROCESSKEY) after compositionend, while isComposing is already false. The existing guard only checked isComposing and the composingRef, so this Enter slipped through and submitted the message before the committed text was fully in the DOM. Add an explicit keyCode 229 check in handleEditorKeyDown. keyCode is deprecated, but it is the only reliable signal for this IME commit Enter on Chromium-based browsers. Includes a dom-repro test that simulates the macOS IME sequence. Fixes: "中文混英文按 Enter 直接上屏"
leeclouddragon
force-pushed
the
fix/desktop-chinese-ime-enter
branch
from
June 7, 2026 05:47
1857d40 to
e6d5f46
Compare
This was referenced Jul 28, 2026
Collaborator
|
Thanks for this fix! It was salvaged into #86760 (cherry-picked onto current main with your authorship preserved in the commit history) and is now merged. Closing since the work has landed. |
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.
macOS Chinese IME (and some 3rd-party Windows IMEs) emit Enter with keyCode 229 (legacy VK_PROCESSKEY) after compositionend, while isComposing is already false. The existing guard only checked isComposing and the composingRef, so this Enter slipped through and submitted the message before the committed text was fully in the DOM.
Add an explicit keyCode 229 check in handleEditorKeyDown. keyCode is deprecated, but it is the only reliable signal for this IME commit Enter on Chromium-based browsers. Includes a dom-repro test that simulates the macOS IME sequence.
This complements #37487 by covering the keyCode 229 case that isComposing alone misses.
Fixes: "中文混英文按 Enter 直接上屏"