Skip to content

Page shots are wider than the viewport when content overflows hidden #115

Closed

Description

@tmashara

Untiled page shots use page.screenshot({ fullPage: true }), which captures the document's scroll width, not the viewport width. If an element sits off-canvas and the page hides it with overflow-x: hidden on body, the user never sees it and can't scroll to it, but the shot comes out wider than the viewport, with the page squeezed into the left part.

Seen on metabase.com /product/starter at 1440: an absolutely positioned cover div with left: 100%; width: 100% (it masks animated clouds) makes scrollWidth 2692, so the shot is 2700 wide and the page fills the left 53%. Report: https://tmashara.github.io/renderdiff-reports/gro-1143/container-xl/report.html#product-starter.1440

The tiled path already uses width (the viewport) for its area, so tall pages don't have this problem and short ones do.

Suggested fix:

  • Shoot the untiled page with clip: { x: 0, y: 0, width, height: scrollHeight } too, so both paths are viewport-wide.
  • Report real horizontal overflow separately: after scrollTo(1e6, 0), if scrollX > 0 the user can scroll sideways, so flag "page scrolls horizontally by N px" on that side. That catches the case the full-width shot was showing, without the misleading picture.

Activity

  1. added
    bug
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions