์ผ€์ด์Šค ce-0241-ime-start-delay-android-ja-en-ko ยท ์‹œ๋‚˜๋ฆฌ์˜ค scenario-ime-start-delay-android

Selecting all text delays IME start on Android (Japanese)

OS: Android 10-14 ๊ธฐ๊ธฐ: Mobile (Samsung Galaxy Tab S9) Any ๋ธŒ๋ผ์šฐ์ €: Chrome for Android 120+ ํ‚ค๋ณด๋“œ: Japanese (IME) - Gboard or Samsung IME ์ดˆ์•ˆ
imecompositionandroidmobilejapanese

ํ˜„์ƒ

On Android virtual keyboards, after selecting all text in a contenteditable element, typing a letter does not immediately start IME composition. The first letter is inserted as plain text, and IME composition only starts from second letter.

์žฌํ˜„ ์˜ˆ์‹œ

  1. Type text in contenteditable element (e.g., โ€œใ“ใ‚“ใซใกใฏโ€).
  2. Press Ctrl+A to select all text.
  3. Type first letter (e.g., โ€œใ‚โ€).

๊ด€์ฐฐ๋œ ๋™์ž‘

  • First letter plain text: โ€˜ใ‚โ€™ is inserted as plain text (not part of IME composition)
  • Selection remains: The โ€œSelect Allโ€ selection stays visible
  • IME starts delayed: IME composition (candidate window) only appears after typing second letter
  • Result: First letter appears as plain text, then IME composition replaces from second letter

์˜ˆ์ƒ ๋™์ž‘

  • IME composition should start immediately when first letter is typed
  • The entire selection should be replaced with IME composition

์ฐธ๊ณ ์‚ฌํ•ญ ๋ฐ ๊ฐ€๋Šฅํ•œ ํ•ด๊ฒฐ ๋ฐฉํ–ฅ

  • Clear selection before typing: Remove selection before user starts new input
  • Detect and handle first letter separately: Check if plain text is inserted before composition starts
  • Use beforeinput event: Monitor inputType = 'insertText' to detect plain text insertion
  • User education: Add UI hint to clear selection before starting new IME input

์ฝ”๋“œ ์˜ˆ์‹œ

const editor = document.querySelector('div[contenteditable]');
let imeStarted = false;
let wasSelectAll = false;

// Detect select all
document.addEventListener('keydown', (e) => {
  if (e.ctrlKey && e.key === 'a') {
    wasSelectAll = true;
  }
});

// Track composition start
editor.addEventListener('compositionstart', () => {
  imeStarted = true;
  // Clear selection if it exists
  const selection = window.getSelection();
  if (selection.rangeCount > 0 && !selection.isCollapsed) {
    selection.removeAllRanges();
  }
});

// Distinguish plain text vs IME
editor.addEventListener('beforeinput', (e) => {
  if (e.inputType === 'insertText' && !imeStarted && wasSelectAll) {
    // Plain text was inserted before IME started
    console.warn('Plain text inserted before IME started:', e.data);
  }
});

editor.addEventListener('keydown', (e) => {
  if (wasSelectAll) {
    // First letter after select all detected
    console.log('First letter after select all:', e.key);
    // Optionally add cleanup logic
  }
});

์ด ์‹œ๋‚˜๋ฆฌ์˜ค์˜ ๋ณ€ํ˜•

์ผ€์ด์Šค OS ๋ธŒ๋ผ์šฐ์ € ์ƒํƒœ
ce-0240-ime-start-delay-android-ko Android 10-14 Chrome for Android 120+ ์ดˆ์•ˆ
ce-0241-ime-start-delay-android-ja-en-ko Android 10-14 Chrome for Android 120+ ์ดˆ์•ˆ

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: Android 10-14
Device: Mobile (Samsung Galaxy Tab S9) Any
Browser: Chrome for Android 120+
Keyboard: Japanese (IME) - Gboard or Samsung 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.