{{ message }}
Repository navigation
fix(studio): respect composition and cancellation in text inputs - #6011
Open
shuaiyafei wants to merge 1 commit into
Open
shuaiyafei wants to merge 1 commit into
shuaiyafei wants to merge 1 commit into
Conversation
This branch has not been deployed
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.

What
Let the shared
Inputfinish an IME composition without treating its Enter/Escape keys as editor commands. Finalize a draft once: Enter followed by blur commits once, and Escape followed by blur commits nothing.Why
The keyboard handler currently intercepts composing key events. Separately, Enter or Escape clears the dirty flag, but blur still commits the captured draft unconditionally. A focused Escape therefore writes the value it just discarded; Enter can notify the caller and tracking callback twice while the parent is still persisting the value.
Related work
Self-contained correction to the shared text
Input. #5947 changesNumberFieldbounds and #4710 changesSelect; they also usevalueControls.test.tsx.How
Return early for composing key events and let blur commit only a dirty draft. This uses the field's existing draft lifecycle and dirty flag.
Before
After
These captures render the actual React component in Chromium. Each row records a fresh-page keyboard sequence; composition events are dispatched explicitly, not generated by an operating-system IME.
Test plan
Four regression cases fail on unchanged source: composing Enter/Escape, Enter then blur, and Escape then blur.
The value-control file now passes 20 tests, including ordinary blur as a positive control. The UI directory passes 68 tests.
Browser assertions reproduce all four failures on the upstream component and pass with the patch, checking committed values, raw tracking-call counts, and whether the key was prevented.
Workspace build, updated Studio build, oxlint/oxfmt, and the full pre-commit and commit-msg hooks passed.
Unit tests added
Browser reproduction performed, with before/after captures
Comment rules reviewed
AI assistance: Codex.