Phenomenon
When composing Korean text with IME in a contenteditable element, pasting content (Ctrl+V) cancels the active composition and loses the composed text. The pasted content may also be inserted in an unexpected position.
Reproduction example
- Focus the editable area.
- Activate Korean IME.
- Start composing Korean text (e.g., type “한글”).
- Press Ctrl+V to paste content before completing composition.
Observed behavior
- The compositionend event fires with incomplete data
- The composed text is lost
- Pasted content is inserted, possibly in wrong position
- The sequence of
paste,compositionend, andinputevents may be inconsistent
Expected behavior
- Composition should complete before paste occurs, or paste should be queued
- Composed text should not be lost
- Pasted content should be inserted in the correct position
- Event sequence should be predictable and consistent
Browser Comparison
- Firefox: Paste may cancel composition
- Chrome: May have different paste behavior during composition
- Edge: Similar to Chrome
- Safari: Not applicable on Windows
Notes and possible direction for workarounds
- Prevent paste during active composition
- Wait for composition to complete, then allow paste
- Handle paste events carefully during composition