macOS: Double-space period breaks inclusive:false marks
OS: macOS 15.0 (Sequoia) · Device: Desktop Any · Browser: All Browsers (ProseMirror context) Latest (Nov 2025)
Open case →Scenario
Technical analysis of how IMEs handle Enter, Backspace, Escape, and programmatic actions during active composition.
Unlike standard keyboard input, IME (Input Method Editor) sessions intercept and buffer keystrokes. This document outlines the patterns for handling functional keys, input events, and programmatic actions while a composition is active.
beforeinput with inputType: "insertParagraph". This often results in a “Double Break” if not handled correctly.In languages like Korean (Hangul), a single Backspace may delete a vowel/consonant (de-composition) rather than the entire character.
beforeinput during de-composition, making it impossible for frameworks to track character-level changes.Attributes like autocorrect, autocapitalize, and autocomplete interact with the IME buffer.
compositionend with a different value than the last compositionupdate. WebKit Bug 265856contenteditable. It can trigger an unexpected textInput event at the start of a sentence which might prematurely flush a CJK buffer. WebKit Bug 148503When typing at offset 0 of a text node or block, Chrome 121 may correctly fire beforeinput but fail to dispatch the final input event after the DOM is modified.
beforeinput to check for missing input dispatches, or rely on MutationObserver as a fallback.In legacy Edge (or specific Windows configurations), the input event may fire twice for a single physical keystroke, potentially causing duplicate UI updates or performance hits.
Attempting to trigger document.execCommand('undo') while isComposing is true results in Immediate Buffer Corruption in Safari. The browser loses track of the shadow-text.
On Android Chrome 131+, switching to the Emoji keyboard mid-composition often cancels the session without committing the buffered character, leading to Data Loss. Chromium Issue #381254331
Implement a state-locked event interceptor.
/* Safety Timer for Missing Inputs */
let inputTimer = null;
element.addEventListener('beforeinput', (e) => {
if (inputTimer) clearTimeout(inputTimer);
inputTimer = setTimeout(() => {
// If 'input' didn't fire, manually sync model
}, 50);
});
element.addEventListener('input', () => {
clearTimeout(inputTimer);
});
Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
Each row is a concrete case for this scenario, with a dedicated document and playground.
| Case | OS | Device | Browser | Keyboard | Status |
|---|---|---|---|---|---|
| ce-0002-ime-enter-breaks | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Korean (IME) | draft |
| ce-0004-ime-backspace-removes-whole-syllable | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Korean (IME) | draft |
| ce-0022-ime-enter-breaks-firefox | Windows 11 | Desktop or Laptop Any | Firefox 120.0 | Korean IME | draft |
| ce-0030-backspace-composition-chrome | macOS Ubuntu 22.04 | Desktop or Laptop Any | Chrome 120.0 | Japanese IME | draft |
| ce-0035-backspace-deletes-whole-word | macOS Ubuntu 22.04 | Desktop or Laptop Any | Safari 120.0 | US | draft |
| ce-0042-input-events-duplicate | Windows 11 | Desktop or Laptop Any | Edge 120.0 | US | draft |
| ce-0058-contenteditable-with-autocomplete | macOS Ubuntu 22.04 | Desktop or Laptop Any | Chrome 120.0 | US | draft |
| ce-0070-contenteditable-with-autocapitalize | iOS 17.0 | iPhone Any | Safari 17.0 | US | draft |
| ce-0071-contenteditable-with-autocorrect | iOS 17.0 | iPhone Any | Safari 17.0 | US | draft |
| ce-0181-japanese-ime-enter-breaks-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Japanese (IME) | draft |
| ce-0182-chinese-ime-enter-breaks-safari | macOS 14.0 | Desktop or Laptop Any | Safari 17.0 | Chinese (IME - Pinyin) | draft |
| ce-0185-japanese-ime-backspace-granularity-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Japanese (IME) | draft |
| ce-0186-chinese-ime-backspace-granularity-safari | macOS 14.0 | Desktop or Laptop Any | Safari 17.0 | Chinese (IME - Pinyin) | draft |
| ce-0195-thai-ime-enter-breaks-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Thai (IME) | draft |
| ce-0196-vietnamese-ime-enter-breaks-edge | Windows 11 | Desktop or Laptop Any | Edge 120.0 | Vietnamese (IME) | draft |
| ce-0199-thai-ime-backspace-granularity-chrome | Windows 11 | Desktop or Laptop Any | Chrome 120.0 | Thai (IME) | draft |
| ce-0200-vietnamese-ime-backspace-granularity-edge | Windows 11 | Desktop or Laptop Any | Edge 120.0 | Vietnamese (IME) | draft |
| ce-0217-keyboard-handlers-iscomposing-false-ios-safari-korean | iOS 17.0+ | iPhone or iPad Any | Safari 17.0+ | Korean (IME) | draft |
| ce-0565-chrome-121-oninput-offset-0 | Windows 11 | Desktop Any | Chrome 121.0.6167.86 | US QWERTY | confirmed |
| ce-0579 | macOS 15.0 (Sequoia) | Desktop Any | All Browsers (ProseMirror context) Latest (Nov 2025) | Apple Magic Keyboard (US) | confirmed |
| ce-0581 | Android 14.0 / 15.0 | Smartphone Any | Chrome 131.0+ | Gboard (Emoji) | confirmed |
This matrix shows which browser and OS combinations have documented cases for this scenario. Click on a cell to view the specific case.
| Browser | Android | Windows | iOS | macOS |
|---|---|---|---|---|
| All Browsers (ProseMirror context) | — | — | — | ce-0579 Latest (Nov 2025) |
| Chrome | ce-0581 131.0+ | ce-0002-ime-enter-breaks ce-0004-ime-backspace-removes-whole-syllable ce-0181-japanese-ime-enter-breaks-chrome ce-0185-japanese-ime-backspace-granularity-chrome ce-0195-thai-ime-enter-breaks-chrome ce-0199-thai-ime-backspace-granularity-chrome ce-0565-chrome-121-oninput-offset-0 120.0, 120.0, 120.0, 120.0, 120.0, 120.0, 121.0.6167.86 | — | |
| Edge | — | — | — | |
| Firefox | — | — | — | |
| Safari | — | — |
This scenario affects multiple languages. Cases are grouped by language/input method below.
OS: macOS 15.0 (Sequoia) · Device: Desktop Any · Browser: All Browsers (ProseMirror context) Latest (Nov 2025)
Open case →OS: macOS 14.0 · Device: Desktop or Laptop Any · Browser: Safari 17.0
Open case →OS: macOS 14.0 · Device: Desktop or Laptop Any · Browser: Safari 17.0
Open case →OS: Android 14.0 / 15.0 · Device: Smartphone Any · Browser: Chrome 131.0+
Open case →OS: macOS Ubuntu 22.04 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Firefox 120.0
Open case →OS: iOS 17.0+ · Device: iPhone or iPad Any · Browser: Safari 17.0+
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: macOS Ubuntu 22.04 · Device: Desktop or Laptop Any · Browser: Safari 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Edge 120.0
Open case →OS: macOS Ubuntu 22.04 · Device: Desktop or Laptop Any · Browser: Chrome 120.0
Open case →OS: iOS 17.0 · Device: iPhone Any · Browser: Safari 17.0
Open case →OS: iOS 17.0 · Device: iPhone Any · Browser: Safari 17.0
Open case →OS: Windows 11 · Device: Desktop Any · Browser: Chrome 121.0.6167.86
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Edge 120.0
Open case →OS: Windows 11 · Device: Desktop or Laptop Any · Browser: Edge 120.0
Open case →Other scenarios that share similar tags or category.
Analysis of how out-of-order or missing composition events disrupt editor state synchronization.
During IME composition or in certain browser/IME combinations, the beforeinput event may have a different inputType than the corresponding input event. For example, beforeinput may fire with insertCompositionText while input fires with deleteContentBackward. This mismatch can cause handlers to misinterpret the actual DOM change and requires storing beforeinput's targetRanges for use in input event handling.
The selection (window.getSelection()) in beforeinput events can differ from the selection in corresponding input events. This mismatch can occur during IME composition, text prediction, or when typing adjacent to formatted elements like links. The selection in beforeinput may include adjacent formatted text, while input selection reflects the final cursor position.
When browser translation features (like Google Translate) are activated, they manipulate the DOM by replacing text content and injecting elements. This can break contenteditable functionality, causing cursor positioning issues, event handling problems, and IME composition failures.
The getTargetRanges() method in beforeinput events may return an empty array or undefined in various scenarios, including text prediction, certain IME compositions, or specific browser/device combinations. When getTargetRanges() is unavailable, developers must rely on window.getSelection() as a fallback, but this may be less accurate.
Have questions, suggestions, or want to share your experience? Join the discussion below.