fix(dropdown): compose ScrollArea with gradient fade overlays for long lists#352
fix(dropdown): compose ScrollArea with gradient fade overlays for long lists#352mattrothenberg wants to merge 7 commits intomainfrom
Conversation
- Add max-h-[var(--available-height)] to constrain popup to viewport - Add inner scroll container with overflow-y-auto and overscroll-contain - Add docs demo with max-height toggle to exercise scroll behavior - Matches Base UI's Combobox scroll pattern
commit: |
Docs PreviewCommit: |
|
/bonk check my work plz |
There was a problem hiding this comment.
Review
✅ Implementation
The ScrollArea composition in dropdown.tsx is well-architected:
- Gradient overlays are correctly positioned outside
ScrollArea.Viewportas siblings, avoiding scroll height pollution - Uses
group-data-[overflow-y-start/end]for clean CSS-driven visibility toggling - Custom scrollbar with
bg-kumo-fillthumb follows Kumo token conventions - Padding moved to
ScrollArea.Contentmaintains consistent spacing
✅ Lint Rule Fix
Adding /^gradient-to-[trbl]{1,2}$/ to NON_COLOR_PATTERNS correctly prevents false positives for gradient direction utilities like bg-gradient-to-b and bg-gradient-to-t.
✅ Documentation & Testing
DropdownLongListDemowith 50 items provides good coverage for scroll behavior- Docs update explains the automatic scroll handling
- Visual regression changes are minor sub-pixel differences expected from ScrollArea composition
⚠️ Issue Found: Duplicate CSS in kumo-binding.css
There's a duplicate .kumo-scroll-fade::after rule (lines 239-245 and 247-253):
/* Lines 239-245 */
.kumo-scroll-fade::after {
--scroll-area-overflow-y-end: inherit;
bottom: 0;
height: min(40px, var(--scroll-area-overflow-y-end, 0px));
margin-top: calc(min(40px, var(--scroll-area-overflow-y-end, 0px)) * -1);
background: linear-gradient(to top, var(--color-kumo-control), transparent);
}
/* Lines 247-253 - DUPLICATE with different values */
.kumo-scroll-fade::after {
--scroll-area-overflow-y-end: inherit;
bottom: 0;
height: min(40px, var(--scroll-area-overflow-y-end, 40px)); /* different default */
margin-top: -40px; /* hardcoded instead of calc() */
background: linear-gradient(to top, var(--color-kumo-control), transparent);
}Also, these .kumo-scroll-fade CSS classes appear unused — the dropdown component uses inline Tailwind classes (bg-gradient-to-b, etc.) instead. These should either be:
- Removed if truly unused
- Or kept for future use but with the duplicate removed
Suggested Fix
Remove lines 247-253 (the duplicate), keeping only lines 227-245.
Summary
| Aspect | Status |
|---|---|
| Dropdown scroll behavior | ✅ Correct |
| Gradient overlay approach | ✅ Clean CSS-only solution |
| Lint rule fix | ✅ Proper |
| Changeset | ✅ Present |
| CSS cleanup |
The core implementation is solid — just needs the duplicate CSS cleaned up before merge.
|
I've completed the review of PR #352 and posted it to GitHub. Here's a summary: Review Summary✅ What's Good
|
|
/bonk I think I addressed your feedback. |
Review SummaryAfter reviewing all the changed files in PR #352, here's my assessment: ✅ Implementation QualityDropdown ScrollArea Composition (
Lint Rule Fix:
✅ Testing & Documentation
✅ Visual RegressionThe 10 screenshot changes reported are all minor sub-pixel differences (0-1.1%) expected from the ScrollArea composition affecting layout slightly. ✅ Regarding the "Duplicate CSS" IssueThe previous review mentioned duplicate Overall
LGTM — The implementation follows Kumo conventions, uses proper semantic tokens, and the duplicate CSS issue does not exist in this PR. |




























































Summary
ScrollAreainsideDropdownMenu.Contentfor proper scroll handlingdata-overflow-y-start/data-overflow-y-enddata attributesbg-kumo-fill) visible on hover/scrollbg-gradient-to-*Tailwind utilitiesApproach
Gradient overlays are composed as sibling divs outside
ScrollArea.Viewportbut insideScrollArea.Root. This avoids polluting scroll height (which caused feedback loops with pseudo-element approaches). Visibility is toggled purely via CSS using thegroup-data-[overflow-y-*]pattern:Inspired by the Select scroll fix in #369 and the Base UI ScrollArea docs.
Review
Testing