Scenario

IME UI & Experience: Viewports, Candidates, and Layout

Managing browser UI collisions, virtual keyboard resizing, and IME candidate window positioning.

ui
Scenario ID
scenario-ime-ui-experience

Details

Overview

The “IME experience” is not just about data—it’s about the physical stability of the editor. Mobile browsers and floating candidate windows frequently collide with application UI.

Key Experience Barriers

1. The ‘Viewport Jump’ (Scroll Anchoring)

When an IME is activated, the browser’s “Visual Viewport” changes.

  • Regression (iOS 18): Focusing a long document frequently fails to anchor the caret, causing the viewport to jump to the top of the container.
  • Android: Chrome often resizes the entire content area, which can cause ‘jumpy’ layout if elements aren’t sized with dv units.

2. Candidate Window Positioning

Floating windows (e.g., Japanese Kanji selection) are rendered by the OS but positioned by the browser.

  • Bug: In Fixed or Absolute containers, WebKit often places the window at the absolute 0,0 screen coordinate instead of anchoring it to the caret.

3. Interactive Widget Behavior

Modern viewports define interactive-widget=resizes-content. Choosing between resizes-content and resizes-visual determines whether the editor’s height shrinks or simply gets covered by the keyboard.

Optimization Strategy: Viewport Sync

/* Use the Visual Viewport API for stabilization */
window.visualViewport.addEventListener('resize', () => {
  if (isFocused && isIMEActive) {
      // Manually force caret into view to prevent snap-jump
      ensureCaretInCenter();
  }
});

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-0580 iOS 18.0 iPhone / iPad Any Safari 18.x Virtual Keyboard confirmed

Cases

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

Related Scenarios

Other scenarios that share similar tags or category.

Tags: viewport, keyboard

Broken viewport mechanics when software keyboard is visible (iOS Safari)

On iOS Safari, when the software keyboard becomes visible, viewport calculations become unreliable. `position:fixed` elements break, `height` returns incorrect values, and absolute positioning with `top`/`bottom` fails. This severely affects editors with floating toolbars or positioned elements.

1 case
Tags: keyboard

iPhone keyboard hides text when entering on contenteditable

On iPhone/iPad Safari, when entering text or pressing "return" multiple times in a contenteditable element, the software keyboard appears but hides the text being typed. The page doesn't auto-scroll to keep text visible. Works fine on Android and other browsers.

1 case
Tags: keyboard

Keyboard navigation accessibility issues in contenteditable

Keyboard navigation in contenteditable elements must comply with WCAG 2.1.1 (Keyboard) and 2.1.2 (No Keyboard Trap) requirements. The Tab key typically moves focus out of contenteditable, while arrow keys move the caret. Custom keyboard handling must ensure all functionality is keyboard-operable and focus remains visible.

0 cases

Comments & Discussion

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