Why does a mobile page shift when the address bar appears or disappears?

A mobile page shifts when browser chrome changes the visible viewport while scrolling. Elements sized with viewport height, fixed to an edge or recalculated by JavaScript may receive new dimensions as the address bar appears or disappears. The shift usually comes from a sizing rule that follows a moving viewport boundary.
Legacy vh behavior varies across mobile browsers. Use svh for a stable size that fits when browser controls occupy their largest space, lvh for the largest available area, and dvh when the section should track the current visible height. A dynamic unit may animate during toolbar movement.
.landing-panel {
min-height: 100svh;
}
@supports (height: 100dvh) {
.immersive-panel {
min-height: 100dvh;
}
}
Fixed headers and footers can expose the difference between the layout and visual viewports. Avoid measuring window.innerHeight on every scroll and writing it into a CSS variable unless the design truly needs that value. Such scripts can force repeated layout and produce larger jumps than the browser toolbar itself.
Check for scroll anchoring and late-loading content too. An image without dimensions or a font swap may move the page at the same moment the toolbar changes, making the cause look browser-specific. Record a performance trace or temporarily remove the full-height section to isolate viewport sizing from ordinary layout shifts.
Test with slow scroll, quick flicks, rotation and a page opened from both the top and a deep anchor. Compare Safari and Chrome on physical phones. Choose stable space for reading pages and dynamic space for experiences that must fill the current screen, then verify that controls stay visible through every toolbar state.