You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Description
TextInput calls
onEnterwhen 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 theonEntercounter from 0 to 1, as shown in the recording.astryx/packages/core/src/TextInput/TextInput.tsx
Lines 431 to 438 in cde73c7
TextInput checks only
e.key === 'Enter'before callingonEnter. The existingisImeKeyEventhelper checks bothisComposingandkeyCode === 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 === 229fallback. Its examples use a textarea; this report concerns TextInput's custom keydown callback, rather than native implicit form submission.Reproduction
Reproduction in Astryx Playground
onEnter callscounter starts at 0.にほんごand convert it to日本語.onEnter callsbecomes 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
onEntercallback.Recording:
textinput.mov
Astryx Version
Hosted Astryx Playground (exact deployed package version unknown; also present in main at cde73c7)
Environment