iOS Safari: Scroll anchoring failure when focusing long editors
OS: iOS 18.0 · Device: iPhone / iPad Any · Browser: Safari 18.x · Keyboard: Virtual Keyboard
Open case →Scenario
Managing browser UI collisions, virtual keyboard resizing, and IME candidate window positioning.
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.
When an IME is activated, the browser’s “Visual Viewport” changes.
dv units.Floating windows (e.g., Japanese Kanji selection) are rendered by the OS but positioned by the browser.
Fixed or Absolute containers, WebKit often places the window at the absolute 0,0 screen coordinate instead of anchoring it to the caret.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.
/* Use the Visual Viewport API for stabilization */
window.visualViewport.addEventListener('resize', () => {
if (isFocused && isIMEActive) {
// Manually force caret into view to prevent snap-jump
ensureCaretInCenter();
}
});
Visual view of how this scenario connects to its concrete cases and environments. Nodes can be dragged and clicked.
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 |
Open a case to see the detailed description and its dedicated playground.
OS: iOS 18.0 · Device: iPhone / iPad Any · Browser: Safari 18.x · Keyboard: Virtual Keyboard
Open case →Other scenarios that share similar tags or category.
Technical analysis of how CSS and attribute-based placeholders disrupt text insertion and IME sessions.
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.
The `inputmode` attribute, which should control the type of virtual keyboard shown on mobile devices, does not work on contenteditable regions in iOS Safari. The keyboard type cannot be controlled.
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.
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.
Have questions, suggestions, or want to share your experience? Join the discussion below.