Skip to content

fix(studio): leave NumberField IME confirmation to the input method - #6512

Open
shuaiyafei wants to merge 1 commit into
heygen-com:mainfrom
shuaiyafei:fix/number-field-ime-confirmation
Open

shuaiyafei wants to merge 1 commit into
heygen-com:mainfrom
shuaiyafei:fix/number-field-ime-confirmation

Conversation

@shuaiyafei

Copy link
Copy Markdown
Contributor

What

Leave NumberField's IME confirmation Enter to the input method instead of committing the inspector value immediately.

This follows the NumberField feedback on #6011. It covers active composition and the legacy WebKit confirmation event (keyCode === 229, even when isComposing is false). A subsequent ordinary Enter still commits and tracks the change once.

How

Guard the existing Enter handler before it prevents the key or calls commitFromText(). Add two regressions and a short numeric-entry note to the canvas guide.

Related work: #6011 covers the text Input; #5947 covers NumberField range clamping.

Before

NumberField commits and tracks on both composition confirmation events

After

NumberField leaves composition confirmation alone while ordinary Enter still commits once

The captures render the actual React component in Chromium with explicit synthetic keyboard events. Operating-system IME behavior and a Safari browser were not exercised.

Verification

  • Both new regressions fail on unchanged main.
  • UI directory: 68 tests pass, including a later ordinary Enter as a positive control.
  • Chromium assertions reproduce the premature commits before the patch and pass afterward, checking committed values, raw tracking-call counts, and default prevention.
  • Full workspace build and updated Studio build pass.
  • Studio typecheck, oxlint and oxfmt pass.
  • mint validate and mint broken-links pass.

AI assistance: Codex.

@mintlify

mintlify Bot commented Oct 27, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 3530934.

Approve preview

SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Oct 28, 2026
Port of upstream PR heygen-com#6512 (head 3530934, open): the Enter that confirms
an IME composition (isComposing, or keyCode 229 on older WebKit) no longer
commits the inspector value; a later plain Enter still commits once.
Adopted ahead of upstream because zh-TW input is this fork's main case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SanHsien added a commit to SanHsien/hyperframes that referenced this pull request Oct 28, 2026
…e watermarks

Commit axis to bf7ebe9 (merge 2fa8452), PR axis to heygen-com#6629 and issue
axis to heygen-com#6610, each item with its verdict, head SHA and trigger in
docs/DECISIONS.md 2026-10-28. Upstream PR heygen-com#6512 is adopted (554dbb7).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at 35309340fd7cd46180b293b02eea47dabed36d98.

The Enter guard keeps both native composition and older WebKit keyCode 229 in the input method. The normal commit and blur dedup paths are unchanged.

Attempted vitest numberFieldComposition.test.tsx --environment jsdom: collection blocked by missing @base-ui/react/number-field. No real IME/browser walk. One unsigned commit remains. Small source guard and authored native-event cases inspected.

Need: yes · Size: ok · Reuse: existing implementation seam · Simpler: already minimal · Structure: fine
Risk: low - IME commit handling.

Verdict: APPROVE
Reasoning: The Enter guard keeps both native composition and older WebKit keyCode 229 in the input method. The normal commit and blur dedup paths are unchanged.

Reasoning: The Enter guard keeps both native composition and older WebKit keyCode 229 in the input method. The normal commit and blur dedup paths are unchanged.

@jrusso1020

Copy link
Copy Markdown
Collaborator

Thanks, @shuaiyafei. This is approved, and the only thing holding it back is commit signing: main requires signed commits. The commit on this branch isn't verified.

To re-sign and push:

git rebase origin/main --exec "git commit --amend --no-edit -S"
git push --force-with-lease

GitHub's setup guide: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

If the content is unchanged, we'll queue it at your new head.

— Rames

This branch has not been deployed

No deployments
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