Repository navigation
[scroll area] Add overscroll feedback to the scrollbar thumb - #5145
Merged
Merged
Conversation
commit: |
Bundle size
PerformanceTotal duration: 1,361.27 ms +162.99 ms(+13.6%) | Renders: 78 (+0)
…and 1 more (+8 within noise) — details Metric alarms
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
atomiks
force-pushed
the
claude/determined-pascal-31f175
branch
4 times, most recently
from
July 1, 2026 06:54
07afe64 to
12a7ea4
Compare
atomiks
force-pushed
the
claude/determined-pascal-31f175
branch
from
July 1, 2026 07:28
12a7ea4 to
4cd1c28
Compare
atomiks
marked this pull request as ready for review
July 1, 2026 07:34
atomiks
requested review from
colmtuite,
flaviendelangle,
jjenzz and
michaldudak
as code owners
July 1, 2026 07:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4682
In Safari/WebKit, overscroll any scroll area (left sidebar, or the demos): https://deploy-preview-5145--base-ui.netlify.app/react/components/scroll-area
Summary
Adds native-style overscroll feedback to the Scroll Area scrollbar: while the viewport rubber-bands past an edge, the thumb shrinks against that edge instead of staying pinned at full size, mirroring the macOS native scrollbar behavior shown in the issue.
Details
computeThumbPositionalready had to clamp away the rubber-band, since Safari is the only engine that reports an out-of-rangescrollTop/scrollLeft. Instead of discarding that value, it now drives the shrink:scrollPos - clamp(scrollPos, 0, maxScroll)—0on every engine except Safari (Chrome/Firefox clamp the scroll position), so this is a no-op elsewhere.height/widthshrinks by the overscroll amount (floored atMIN_THUMB_SIZE) and stays pinned to the overscrolled edge.The size change is applied via
height/widthrather than ascaleY/scaleXtransform, so rounded thumb caps stay round during the overscroll.Testing
The overscroll path is only reachable in Safari — jsdom has no layout and Chromium clamps the scroll position on assignment, so it can't be exercised in CI. Verified manually in Safari (vertical + horizontal, rounded thumb, both edges). The in-range behavior is unchanged and remains covered by the existing Chromium test suite.