On phones, every docs page on reactnative.dev, React Native's website, could be dragged sideways. At 320px wide the page was 86px wider than the screen. The cause was the version menu next to "Docs": closed and invisible, it still took up space past the right edge of the screen. We sent a 7-line CSS fix, and React Native's maintainers merged it on 29 November 2026 as react/react-native-website#5349.
React Native is Meta's framework for building native apps with React. Its main repository has more than 127,000 GitHub stars, and the react-native package is downloaded about 21 million times a week.
This post covers what was broken, how it was fixed, and how renderlint reports this kind of bug on your own site.
What was broken?
The docs header has a row with the "Docs" title, a section menu ("Components") and a version menu ("0.88"). When you tap the version pill, a 170px list of versions opens below it. On a phone, that list ran past the right edge of the screen and was cut off.
Even with the menu closed, the page scrolled sideways. The amount depended on the screen width:
| Viewport | 320px | 360px | 375px | 390px | 400px | 414px and wider |
|---|---|---|---|---|---|---|
| Extra page width | 86px | 46px | 31px | 16px | 6px | none |

Why did a closed menu make the page scroll?
The menu is positioned with left: 0, so its left edge lines up with the left edge of its button. On a 320px phone that button starts about 236px from the left of the screen, so the 170px menu ends at about 406px.
While the menu is closed it has visibility: hidden. That hides it, but it still takes up space in the layout. An element with visibility: hidden or opacity: 0 keeps its size and position, so it still counts when the browser works out how wide the page is. Only display: none takes an element out of the layout.
So nothing visible stuck out, but the page was still 406px wide on a 320px screen.
What was the fix?
At 480px and below, the menu now lines up with the right edge of its button instead of the left:
@media (max-width: 480px) {
[class*="versionDropdown"] .dropdown__menu {
left: auto;
right: 0;
}
}
At 320px the menu now spans 138px to 308px, inside the screen. We checked 4 docs pages at 12 widths from 320px to 1440px, in light and dark mode, and none of them scrolled sideways after the change. Wider screens look exactly as before.
How renderlint catches hidden elements that widen the page
This bug is easy to miss by eye: nothing sticks out, so you only notice it when the page moves under your thumb. renderlint's viewport-overflow rule measures it. When a page scrolls sideways, renderlint looks for the element responsible. If nothing visible explains the extra width, it checks hidden elements that still take up space past the screen edge, such as closed menus, off-canvas panels and tooltips. Then it names the element:
✖ viewport-overflow A hidden element (visibility: hidden, such as a closed menu)
extends 93px beyond the 320px viewport, so the page scrolls sideways although
nothing visible sticks out. Keep it inside the viewport (for a menu, align it to
the right of its toggle) or use display: none while it is closed.
renderlint checks every page at phone, tablet and desktop widths, so a menu that only overflows below about 410px, like this one, still gets reported.
How to check your own site
Point renderlint at a running dev server, a static build or a live URL:
npx -y @yitec/renderlint http://localhost:3000
It checks each page at phone, tablet and desktop widths and exits with code 1 when it finds an error, so it can gate a build or a CI job. To have your coding agent set it up and run it after every UI change, see Get started.
Frequently asked questions
Does visibility: hidden remove an element from the layout?
No. An element with visibility: hidden is invisible and can't be clicked, but it keeps its size and position. It still pushes other content around, and it still counts toward the page's scroll width. opacity: 0 behaves the same way. Only display: none takes an element out of the layout completely.
How do I find what makes my page scroll sideways?
Compare document.documentElement.scrollWidth with window.innerWidth in the browser console. If the scroll width is bigger, look for elements whose getBoundingClientRect().right is greater than innerWidth, including hidden ones such as closed menus, off-canvas panels and tooltips. renderlint does this at every width it checks and names the element.
Why align a dropdown menu to the right of its button?
A menu that opens below a button near the right edge of the screen runs off the screen when it is lined up with the button's left edge. Lining it up with the button's right edge (left: auto; right: 0) keeps it on screen. Many menu components have an option for this, often called align="end" or position="right".
Which other projects merged fixes from these scans?
Nineteen projects in total, including Cloudflare's developer docs, Ant Design, Hugo, Sentry, Preact, Istio, Infer and Buck2 (Meta), choosealicense.com (GitHub), Mantine, XState, Ruby and Effect. The first four are described in Four layout bugs renderlint found in Ant Design, Mantine, Nuxt UI and Panda CSS. The full list is in the renderlint README.