intel-request: Enter key submits form when using Chinese IME — issue still exists
When using a Chinese IME, pressing Enter to confirm character selection unexpectedly triggers form submission.
Steps to reproduce:
Open the form
Focus on a text input field
Switch input method to Chinese IME
Type Chinese characters
Press Enter to select a character
Expected result: Pressing Enter should confirm the IME character selection and NOT submit the form.
Actual result: The form is submitted immediately when Enter is pressed.
Environment:
OS: macOS
Browser: Edge
IME: Chinese IME (Traditional)
https://roadmap.embedmyreviews.com/en/p/enter-key-submits-form-when-using-chinese-ime
Log in to comment and vote
Comments1
Support Team
Jul 1
x-data="{
imeComposing: false,
lastCompositionEnd: 0,
isImeEnter(e) {
return e.isComposing || e.keyCode === 229 || this.imeComposing ||
(e.key === 'Enter' && Date.now() - this.lastCompositionEnd < 300)
}
}"
@compositionstart="imeComposing = true"
@compositionend="imeComposing = false; lastCompositionEnd = Date.now()"
@keydown.enter.capture="if (isImeEnter($event)) { $event.preventDefault(); $event.stopImmediatePropagation(); }"
@submit.capture="if (Date.now() - lastCompositionEnd < 300) { $event.preventDefault(); $event.stopImmediatePropagation(); }"