Sitelet https://github.com/lit/lit/pull/5397
Skip to content

fix(virtualizer): exclude scrollbar gutters from viewport - #5397

Open
minwookshin wants to merge 1 commit into
lit:mainfrom
minwookshin:fix/virtualizer-scrollbar-viewport
Open

minwookshin wants to merge 1 commit into
lit:mainfrom
minwookshin:fix/virtualizer-scrollbar-viewport

Conversation

@minwookshin

Copy link
Copy Markdown

Fixes #5297.

Intersect the virtualizer viewport with each element's client area, excluding borders and classic scrollbar gutters. This prevents grid columns from overflowing their available width while retaining clipping from scrolling ancestors.

Added regressions cover bordered and unbordered grids, resizing, the final item, and an external scroller. All 117 virtualizer browser tests pass, along with the package build, ES5 compatibility check, lint, and formatting. Native Firefox Nightly also verified both border cases with a measured 15px scrollbar gutter.

Includes a patch changeset. Existing RTL grid positioning is outside this change.

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 57118b0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lit-labs/virtualizer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Signed-off-by: Minwook Shin <im.minwookshin@gmail.com>
Signed-off-by: Minwook Shin <163576506+minwookshin@users.noreply.github.com>
@minwookshin
minwookshin force-pushed the fix/virtualizer-scrollbar-viewport branch from 09f9617 to 57118b0 Compare October 4, 2026 03:51

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[labs/virtualizer] When using a grid layout, the Scroller overflows horizontally due to the scrollbar

1 participant