Case ce-0229-korean-ime-focus-blur-chrome · Scenario scenario-ime-composition-focus-change

Partial character commit when moving focus to another textbox during IME composition

OS: Windows 10/11 Device: Desktop or Laptop Any Browser: Chrome 120+ Keyboard: Korean (IME) - Microsoft IME Status: draft
composition ime focus blur korean

Phenomenon

When composing text with Korean IME in a contenteditable element, moving focus to another textbox causes the composition to not properly terminate.

Reproduction example

  1. Focus the first contenteditable element.
  2. Activate Korean IME.
  3. Start composing a character (e.g., ‘나’ = ㅎ + ㄴ).
  4. Before composition completes (after typing initial consonant ㅎ), click the second textbox or move focus using a button.

Observed behavior

  • compositionend event fires: compositionend fires in the first field, but the composition is not fully cleaned up.
  • Partial jamo remains: The jamo ‘ㅎ’ remains in the first field.
  • Second field focus fails: Focus does not move to the second field, or if it does, the composition state does not continue properly.
  • Input continues: Continuing to type in the new field behaves as if the previous composition completed, but the first field’s state is not cleaned up.

Expected behavior

  • Composition should fully terminate and the final character (‘나’) should be committed to the first field.
  • Focus should smoothly move to the second field.

Notes and possible direction for workarounds

  • Detect compositionend: Check if compositionend event has fired before moving focus.
  • setTimeout delay: Add a small delay (100-200ms) to focus movement to give the IME time to clean up the composition.
  • Composition state flag: Use isComposing flag to prevent focus movement during composition.
  • UI feedback: Disable buttons that move focus to other fields during composition, or provide visual feedback.

Code example

let isComposing = false;

const editor1 = document.querySelector('div[contenteditable]:nth-child(1)');
const editor2 = document.querySelector('div[contenteditable]:nth-child(2)');

// Track composition state
editor1.addEventListener('compositionstart', () => {
  isComposing = true;
});

editor1.addEventListener('compositionend', () => {
  isComposing = false;
  // Move focus after composition completes
  setTimeout(() => {
    editor2.focus();
  }, 100);
});

// Safely move focus on button click
document.querySelector('button').addEventListener('click', () => {
  if (!isComposing) {
    editor2.focus();
  } else {
    alert('IME input in progress. Please wait for completion.');
  }
});
Before
Composing '나' with Korean IME (after typing ㅎ, before typing ㄴ)
❌ After (Bug)
Only jamo 'ㅎ' remains in first field, focus move to second field fails
vs
✅ Expected
Composition completes, then focus moves to second field

Browser compatibility matrix

This matrix shows which browser and OS combinations have documented cases for this scenario. The current case is highlighted. Click on a cell to view other cases.

Current case
Confirmed
Draft
No case documented

All variants (detailed table)

Complete list of all cases for this scenario with full environment details.

Case OS Device Browser Keyboard Status
ce-0229-korean-ime-focus-blur-chrome Windows 10/11 Desktop or Laptop Any Chrome 120+ Korean (IME) - Microsoft IME draft
ce-0230-korean-ime-focus-blur-firefox Windows 10/11 Desktop or Laptop Any Firefox 120+ Korean (IME) - Microsoft IME draft
ce-0231-korean-ime-focus-blur-safari macOS 13+ Desktop (Mac) Any Safari 17+ Korean (IME) - macOS Korean Input Method draft

Playground for this case

Use the reported environment as a reference and record what happens in your environment while interacting with the editable area.

Reported environment
OS: Windows 10/11
Device: Desktop or Laptop Any
Browser: Chrome 120+
Keyboard: Korean (IME) - Microsoft IME
Your environment
Sample HTML:
Event log
Use this log together with the case description when filing or updating an issue.
0 events
Interact with the editable area to see events here.

Comments & Discussion

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