Scenario

Korean IME composition causes editor crash (Firefox)

On Firefox with Windows 10 and Korean IME, specific key combination during IME composition causes the editor to crash. The crash occurs when typing certain sequences with the Korean IME.

ime
Scenario ID
scenario-ime-korean-crash-firefox

Details

On Firefox with Windows 10 and Korean IME, specific key combination sequences during IME composition can cause the contenteditable editor to crash unexpectedly.

Problem Description

This issue occurs specifically when:

  1. User is on Windows 10
  2. Using Firefox browser
  3. Using Korean IME (e.g., Microsoft IME)
  4. Typing specific key sequences during IME composition

Crash Scenario

Based on the GitHub issue, the crash sequence is:

  1. Enable Korean IME
  2. Type ㅀ (press ‘f’, then ‘g’ on QWERTY keyboard)
  3. Hit Enter to confirm composition
  4. Press Ctrl+Shift+Home

Expected Behavior

  • Editor should handle the key sequence normally
  • No crash should occur
  • IME composition should complete or be interrupted gracefully

Actual Behavior (Firefox Bug)

  • Editor crashes: The contenteditable editor completely crashes
  • JavaScript execution stops
  • User must reload the page

Affected Browsers

  • Firefox (Windows 10, with Korean IME) - Issue confirmed
  • Chrome - Does NOT exhibit this crash
  • Safari - Does NOT exhibit this crash

Affected Languages

  • Korean IME (Microsoft IME on Windows)
  • Similar issues may occur with other IMEs

Root Cause

Firefox’s IME handling appears to have a race condition or memory corruption when:

  1. Processing specific key sequences (like Ctrl+Shift+Home) during active IME composition
  2. The IME state management and editor DOM state get out of sync
  3. Internal selection/range calculation crashes when conflicting operations occur

Workarounds

  1. Prevent Ctrl+Shift+Home during composition:

    let isComposing = false;
    
    editor.addEventListener('compositionstart', () => {
      isComposing = true;
    });
    
    editor.addEventListener('keydown', (e) => {
      if (isComposing && e.ctrlKey && e.shiftKey && e.key === 'Home') {
        e.preventDefault();
        // Prevent problematic key combination during IME
      }
    });
    
    editor.addEventListener('compositionend', () => {
      isComposing = false;
    });
  2. Try-catch around critical operations:

    editor.addEventListener('input', (e) => {
      try {
        // Handle input event
      } catch (error) {
        console.error('Input error:', error);
        // Recover gracefully
      }
    });
  3. Use try-finally for cleanup:

    try {
      // IME operations
    } finally {
      // Always cleanup state
    }

References

Scenario flow

Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.

React Flow mini map

Variants

Each row is a concrete case for this scenario, with a dedicated document and playground.

Case OS Device Browser Keyboard Status
ce-0261-korean-ime-crash-firefox-en Windows 10 Desktop Any Firefox 120+ Korean (IME) - Microsoft IME draft

Cases

Open a case to see the detailed description and its dedicated playground.

Related Scenarios

Other scenarios that share similar tags or category.

Tags: composition, ime, korean, firefox

Escape key during IME composition

Escape typically cancels IME composition or closes the candidate window. In Edge, Firefox, and other engines, timing and whether partial text remains in the DOM differ—Arabic and Korean IME cases show cross-browser variance.

2 cases
Tags: composition, ime, korean, firefox

IME composition when focus moves between elements (Korean and others)

If the user switches focus to another field, button, or nested contenteditable while Korean (or other) IME composition is active, browsers differ on whether composition is committed, cancelled, or leaves orphan state. Chrome, Safari, and Firefox do not agree; mobile adds more variance.

3 cases
Tags: composition, ime, korean, firefox

Paste during IME composition cancels or corrupts composition

Pasting from the clipboard while IME composition is active may cancel the composition session, replace the wrong range, or interleave pasted text with unfinished syllables—Firefox and Chrome show different behavior for Korean and Hindi IME paths.

2 cases
Tags: composition, ime, korean

Blur and focus during IME composition (CJK and Japanese Safari)

Moving focus away from the editor while composing text (Chinese, Japanese, Korean) can cancel composition, commit partial text, or leave the IME candidate window out of sync. Safari often shows distinct behavior for Japanese; Chrome behavior for Chinese/Korean is covered in related cases.

2 cases

Comments & Discussion

Have questions, suggestions, or want to share your experience? Join the discussion below.