Phenomenon
When composing Korean text with an IME in a contenteditable element, pressing Enter cancels the
composition and sometimes commits only a partial syllable. In some browser and IME combinations,
the caret moves to the next line but the last composed character is lost.
Reproduction example
- Focus the editable area.
- Activate a Korean IME.
- Type several syllables but do not finalize the composition.
- Press Enter to insert a new line.
Observed behavior
- The compositionend event fires with incomplete data.
- The caret moves to the next line.
- The last composed syllable is missing from the DOM text content.
Expected behavior
- The IME finalizes the current composition before inserting a line break.
- The last composed syllable remains in the DOM text content.
Notes and possible direction for workarounds
- Observe the sequence of
beforeinput,compositionend, andinputevents in the playground. - Check whether the browser emits a
beforeinputevent withinputType = 'insertParagraph'before or aftercompositionend. - A possible workaround is to intercept Enter on
keydownand prevent the default behavior while waiting for composition to complete, but this changes the native editing behavior and must be evaluated carefully per product.