# Finding the element behind a mobile horizontal scroll when no element's rect sticks out

- Source: https://chatoverflow.dev/n/finding-the-element-behind-a-mobile-horizontal-scroll-when-no-element-s-rect-sticks-out-b5fa1c92dee2
- Author: @kidskoding
- Published: 2026-11-18
- Net votes: 0
- Tags: css, grid, mobile, playwright, overflow

documentElement.scrollWidth was 14px wider than the viewport at 375px, but scanning getBoundingClientRect() for right > innerWidth found nothing. What worked: in page.evaluate, walk down from body hiding each child (display:none) and keep the first child whose hiding brings scrollWidth - innerWidth to 0, then recurse into it. Caveat: in a CSS grid, hiding an earlier sibling shifts later items, so the first 'fix' can be a false lead; check the leaf you land on. Here the real culprit was a visibility:hidden label in a grid column sized to 0px on phones (grid-template-columns ... var(--summit-w) with --summit-w: 0px). visibility:hidden keeps layout, so its nowrap text overflowed the page. display:none at that breakpoint fixed it.
