iOS 26 Safari & WebView: VisualViewport.offsetTop not reset after keyboard dismissal, causing fixed elements misplacement

1. System/device combinations where the issue does not occur:

Physical device: iOS 26.0 (23A5318c) + iPhone 16 Pro Max

2. System/device combinations where the issue does occur:

System versions:

Physical device: iOS 26.0 (23A5330a), iOS 26.0 (23A340) Simulator: iOS 26.0 (23A339)

Device models:

Physical device: iPhone 12

Reproducible in Safari, WKWebView, and UIWebView:

Yes

Actual behavior

In WebView (and identically in Safari):

  • Before the keyboard is shown, header/footer elements with position: fixed are correctly aligned with the screen viewport. Scrolling up/down works as expected.

  • After the keyboard appears, the visualViewport position changes.

  • Bug: When the keyboard is dismissed, visualViewport.offsetTop does not reset to 0. As a result, fixed header/footer elements remain misaligned:

    • When scrolling down, the position looks correct.
    • When scrolling up, the header/footer are visibly offset.

Steps to reproduce

  1. Focus an input field → the keyboard appears
  2. Dismiss the keyboard
  3. Observe that visualViewport.offsetTop remains >0 (does not reset to zero)
  4. position: fixed header/footer elements are misplaced relative to the screen

Expected behavior

  1. After the keyboard is dismissed, visualViewport.height should return to match the layout viewport, and visualViewport.offsetTop should reset to 0.
  2. When scrolling upward, fixed elements should remain correctly positioned within the layout viewport.

Minimal reproducible demo

A simple HTML file containing:

  • A header and footer with position: fixed
  • An input element to trigger the keyboard
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
        <title>H5 吸顶吸底页面 Demo</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }

            body {
                font-family: Arial, sans-serif;
                height: 2000px; /* 设置内容高度 */
                background-color: #f0f8ff; /* body 背景浅蓝色 */
                padding-top: 120px; /* 预留 header 高度 */
                padding-bottom: 60px; /* 预留 footer 高度 */
                overflow-x: hidden;
            }

            /* 吸顶 Header */
            header {
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 120px;
                background-color: #ff6b6b; /* 红色 */
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-size: 24px;
                font-weight: bold;
                z-index: 1000;
            }

            /* 吸底 Footer */
            footer {
                position: fixed;
                bottom: 0;
                left: 0;
                width: 100%;
                height: 60px;
                background-color: #4ecdc4; /* 青绿色 */
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-size: 18px;
                font-weight: bold;
                z-index: 1000;
            }

            /* 输入框样式 */
            .input-container {
                margin: 100px auto;
                width: 80%;
                max-width: 600px;
                text-align: center;
            }

            input[type='text'] {
                padding: 12px;
                font-size: 16px;
                border: 2px solid #ddd;
                border-radius: 8px;
                width: 100%;
                box-sizing: border-box;
            }

            input[type='text']:focus {
                outline: none;
                border-color: #4ecdc4;
            }
        </style>
    </head>
    <body>
        <!-- 吸顶 Header -->
        <header>吸顶 Header (120px)</header>

        <!-- 主体内容 -->
        <div class="input-container">
            <input type="text" placeholder="请输入内容..." />
        </div>

        <!-- 吸底 Footer -->
        <footer>吸底 Footer (60px)</footer>
    </body>
</html>
Answered by DTS Engineer in 857887022

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. Please file a bug report, include a small Xcode project and some directions that can be used to reproduce the problem, and post the Feedback number here once you do. If you post the Feedback number here I'll check the status next time I do a sweep of forums posts where I've suggested bug reports.

Bug Reporting: How and Why? has tips on creating your bug report.

Behavior bugs don't only occur when opening/closing the keyboard.

It's the overall behavior of elements in sticky/absolute/fixed positions that are broken because of this new weird viewport.

For example, if you go to Apple's website (https://www.apple.com/) and scroll down, the header will be sticky, but if you look closely, part of the header will extend a few pixels above the viewport.

This is the bug report on Webkit's tracker: https://bugs.webkit.org/show_bug.cgi?id=297779

Might be worth chiming in there to get their attention.

This even happens on the Apple website, for example when viewing feature details on the iPad Air website

What is going on with that? anyone has any update?

It's absolutely wild to me that Apple has not responded to this yet?

Millions of business critical websites are broken, including their own website Apple.com.

Ours is completely mangled too - i've honestly never seen worse pushed to browser production.

@Enzagi thanks for filing FB19889436. I checked on the status of your bug repot and it is in the process of being routed to the engineering team. I added some notes in there asking for it to be routed to a specific group.

In the iOS 26 public beta I see that the fixed position is working again. One issue that remains broken is if you turn on "Reduce Motion" (Settings->Accessibility->Motion->"Reduced Motion"), then turn on "Prefer Cross-Fade Transitions" the fixed position is quite messed up. I see the elements that should be positioned on the bottom of the screen roughly halfway up the screen on scroll up.

I think it's worth noting that there are a number of other posts. Please consider filing bug reports as well and posting the bug numbers here. Duplicates matter and help engineering quantify how many developers are affected by an issue.

Bug Reporting: How and Why? has tips on creating your bug report.

In iOS 26.1 beta the problem seems to be resolved for me. Can anyone confirm if it has also been fixed in version 26.0.1? I’d prefer not to downgrade just to check.

Thanks!

I just update to 26.0.1 and the problem was not solved.

It seems to be a general issue with the IOS 26 release.

It affects other browser too. I tested on Safari, Chrome, Firefox, Edge and Bravo.

With the exception of Edge, all the others display the behavior.

  • Device: iPhone 15 Pro
  • IOS Version: 26.0.1

We use Capacitor to wrap a web app and are running into the same issue. In our case, even the clickable areas for inputs and text fields shift downward, so users have to tap below the actual fields to activate them. Will this too be fixed?

iOS 26 Safari & WebView: VisualViewport.offsetTop not reset after keyboard dismissal, causing fixed elements misplacement
 
 
Q