Explore Bato Web Agency Webflow Certified Partner Profile Explore Bato Web Agency Webflow Certified Partner Profile

Why does a fixed element jump when the mobile browser toolbar changes?

Illustration without a description Illustration without a description

A fixed element can jump when a mobile browser’s address or navigation toolbar expands and collapses because the visible area changes during scrolling. The layout viewport and visual viewport are not always the same size. A bottom bar positioned against one viewport may appear to move as the browser chrome changes the other.

 

Avoid sizing the surrounding layout with legacy 100vh when the component must track the currently visible height. Dynamic viewport units such as dvh follow toolbar changes, while small and large viewport units provide stable lower and upper sizes. Choose the unit according to whether movement or unused space is more acceptable.

 

.screen {
min-height: 100svh;
}

.bottom-action {
position: fixed;
inset-inline: 0;
bottom: env(safe-area-inset-bottom, 0px);
}

 

Safe-area insets protect controls from a home indicator or display cutout, but they do not solve every toolbar animation. Transforms on ancestors can change the containing block for a fixed descendant and create a separate jump. Inspect parent transform, filter, perspective and containment rules before blaming viewport units.

 

JavaScript tied to scroll can amplify the movement by reading geometry and writing position every frame. Prefer CSS positioning for ordinary bars. If the control must follow the visual viewport while a keyboard or pinch zoom changes it, observe visualViewport resize and scroll events sparingly and expect browser-specific timing.

 

Test slow and fast scrolling on real devices with the toolbar initially expanded and collapsed. Rotate the phone, open the keyboard and pinch zoom if the control remains visible in those states. A fixed action should never cover focused fields or page content, and minor toolbar animation should not trigger expensive layout work.