Skip to content

fix(scroll-area): wrap viewport children in Content for base-ui#10539

Open
tautik wants to merge 1 commit intoshadcn-ui:mainfrom
tautik:fix/scroll-area-base-content
Open

fix(scroll-area): wrap viewport children in Content for base-ui#10539
tautik wants to merge 1 commit intoshadcn-ui:mainfrom
tautik:fix/scroll-area-base-content

Conversation

@tautik
Copy link
Copy Markdown

@tautik tautik commented Apr 29, 2026

wrap viewport children in <ScrollAreaPrimitive.Content> for the base-ui scroll-area. base-ui's Content attaches a ResizeObserver that recalculates the thumb when content dimensions change — without it the thumb stays stale when content shrinks (e.g. collapsing a tree node), since the viewport's onScroll never fires for shrink-only updates.

ref: https://base-ui.com/react/components/scroll-area#content

radix-* variants are unaffected (different api).

closes #10534

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 29, 2026

@tautik is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

base-ui's ScrollArea.Content attaches a ResizeObserver that recalculates
the thumb when content size changes. without it the thumb stays stale
when content shrinks (e.g. a collapsed tree node) since the viewport's
onScroll never fires for shrink-only updates.

closes shadcn-ui#10534
@tautik tautik force-pushed the fix/scroll-area-base-content branch from f8b9c62 to 3deca39 Compare April 29, 2026 20:24
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.

[bug]: ScrollArea scrollbar thumb not recalculated when content DOM changes (missing ScrollArea.Content)

1 participant