Case ce-0237-chinese-ime-pinyin-table-ios-safari-en · Scenario scenario-ime-table-cell-pinyin-safari

IME composition shows Pinyin in table cells on iOS Safari

OS: iOS 16+ Device: Mobile (iPhone/iPad) Any Browser: Safari 16+ Keyboard: Chinese (IME) - iOS Chinese Input Status: draft
composition ime table chinese pinyin ios mobile

현상

In iOS Safari, when typing Chinese IME text in table cells (<td>), pressing Space to confirm composition causes both raw Pinyin buffer and confirmed Chinese characters to appear together.

재현 예시

  1. Tap on a table cell (<td> element) to focus.
  2. Activate Chinese IME (iOS Chinese keyboard).
  3. Type Pinyin “nihao” (for Chinese characters “你好”).
  4. Press Space to confirm composition.

관찰된 동작

  • Duplicate text: Pinyin “nihao” and Chinese “你好” appear together → “nihao 你好”
  • Table cells only: Behavior does not occur in paragraph elements (<p>, <div>)
  • iOS Safari specific: Similar to desktop Safari but on mobile devices
  • Works in Chrome/Firefox: Other browsers do not exhibit this bug

예상 동작

  • Pinyin buffer (“nihao”) should NOT be visible
  • Only confirmed Chinese characters (“你好”) should appear

참고사항 및 가능한 해결 방향

  • Use div instead of td: Replace <td> with <div> for editable content when possible
  • Force DOM cleanup: Remove Pinyin text after composition completes
  • Avoid direct editing in table cells: Use modal or overlay for table cell editing
  • Consider non-table structures: Use CSS grid or flexbox instead of HTML tables

코드 예시

const cell = document.querySelector('td[contenteditable]');
let isComposing = false;

cell.addEventListener('compositionstart', () => {
  isComposing = true;
});

cell.addEventListener('compositionend', () => {
  isComposing = false;
  setTimeout(() => {
    const text = cell.textContent;
    const cleaned = text.replace(/[a-z]+/g, '');
    cell.textContent = cleaned;
  }, 0);
});

cell.addEventListener('keydown', (e) => {
  if (isComposing && e.key === ' ') {
    e.preventDefault();
    // Let IME complete naturally
  }
});
Before
Empty table cell
Step 1: Type Pinyin 'nihao'
nihao
Typing Pinyin with IME (candidates shown)
vs
✅ Expected
你好
Expected: Only Chinese characters should remain

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.

Browser Windows iOS macOS
Edge (Chromium-based)
Firefox
Safari
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-0237-chinese-ime-pinyin-table-ios-safari-en iOS 16+ Mobile (iPhone/iPad) Any Safari 16+ Chinese (IME) - iOS Chinese Input draft
ce-0239-chinese-ime-pinyin-table-firefox-en macOS 13+ Desktop (Mac) Any Firefox 120+ Chinese (IME) - macOS Chinese Input confirmed
ce-0238-chinese-ime-pinyin-table-edge-en Windows 10/11 Desktop Any Edge (Chromium-based) 120+ Chinese (IME) - Windows Chinese Input confirmed

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: iOS 16+
Device: Mobile (iPhone/iPad) Any
Browser: Safari 16+
Keyboard: Chinese (IME) - iOS Chinese Input
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.