Skip to content

Instantly share code, notes, and snippets.

@jonrandy
Created July 3, 2026 03:55
Show Gist options
  • Select an option

  • Save jonrandy/006342c9149f23d0f66259f362ed1282 to your computer and use it in GitHub Desktop.

Select an option

Save jonrandy/006342c9149f23d0f66259f362ed1282 to your computer and use it in GitHub Desktop.
How to handle 'enter' form submission WITHOUT breaking IME input (Korean, Japanese, Chinese etc.)
// put this in key event - key 229 is legacy (older browser send different 'key' for return while composing)
if (e.isComposing || e.keyCode === 229) return;
// safe to submit here if you want
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment