Skip to content

Navigation Menu

Sign in
Sign up

[Bug] TextInput onEnter fires when confirming Japanese IME conversion #6082

Open
Labels
bugSomething isn't working

Description

Description

TextInput calls onEnter when Enter is used to confirm a Japanese IME conversion. Applications using this callback for submission or saving can therefore trigger the action before the user intends to submit.

Expected: Enter used to confirm an IME conversion should not call onEnter. A subsequent Enter after composition has finished should call it once.

Actual: Confirming the conversion to 日本語 also increments the onEnter counter from 0 to 1, as shown in the recording.

onKeyDown={
onEnter || onKeyDown
? e => {
if (e.key === 'Enter') {
onEnter?.();
}
onKeyDown?.(e);
}

TextInput checks only e.key === 'Enter' before calling onEnter. The existing isImeKeyEvent helper checks both isComposing and keyCode === 229, but is not used here.

Related: #4892 (systematic IME composition guards).

Reference

GoogleChrome modern-web-guidance: IME-safe enter-to-submit (v0.0.186) explains composition checks for custom Enter handlers, including Safari event-ordering behavior and the keyCode === 229 fallback. Its examples use a textarea; this report concerns TextInput's custom keydown callback, rather than native implicit form submission.

Reproduction

Reproduction in Astryx Playground

  1. Open the Playground and enable a Japanese IME.
  2. Focus the input. The onEnter calls counter starts at 0.
  3. Type にほんご and convert it to 日本語.
  4. Press Enter once to confirm the conversion.
  5. Observe that onEnter calls becomes 1 even though Enter was used only to confirm the IME conversion. It should remain 0.

The demo keeps the input value and displays a counter and the value captured by each onEnter callback.

Recording:

textinput.mov

Astryx Version

Hosted Astryx Playground (exact deployed package version unknown; also present in main at cde73c7)

Environment

  • OS: macOS Tahoe 26.6.2 (25G83)
  • Google Chrome 152.0.7977.82 (Official Build), Stable, arm64 — reproduced
  • Google Chrome 155.0.8040.2 (Official Build), Dev, arm64 — reproduced
  • Safari 26.6.2 (21624.5.1.11.3) — reproduced
  • Firefox: could not reproduce in testing (version not recorded)
  • Input method: Japanese IME (specific IME name not recorded)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      AltStyle によって変換されたページ (->オリジナル) /