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.
After the user or the page scrolls while editing in iOS Safari, the caret may render in the wrong place, disappear until the next tap, or sit outside the visible viewport—especially with fixed headers or virtual keyboard resize.
Mobile browsers may scroll the page to bring the focused field into view when the virtual keyboard opens—sometimes overscrolling or hiding fixed UI and the caret.
The visual viewport shrinks when the keyboard appears; fixed toolbars, sticky UI, and caret visibility interact with resize and scroll events differently than desktop.
Automatic scroll-to-caret may fail when the editable is inside nested scrollers, overflow hidden ancestors, or during rapid input—the user loses sight of the insertion point without manual scroll.
On some mobile browsers, focusing a contenteditable programmatically or from a non-gesture path may not raise the virtual keyboard—users cannot type until they tap again.
Have questions, suggestions, or want to share your experience? Join the discussion below.