fix(scroll-area): add max-h-[inherit] to viewport to fix max-height s…#1737
fix(scroll-area): add max-h-[inherit] to viewport to fix max-height s…#1737YassineJlassi123 wants to merge 2 commits intounovue:devfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdded the Tailwind class Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/v4/registry/new-york-v4/ui/scroll-area/ScrollArea.vue`:
- Line 26: The bases/reka ScrollArea variant is missing the max-h-[inherit] fix;
update the ScrollAreaViewport element in the ScrollArea.vue component (the same
class attribute that currently includes "focus-visible:ring-ring/50 size-full
rounded-[inherit] transition-[color,box-shadow] outline-none
focus-visible:ring-[3px] focus-visible:outline-1") to also include
"max-h-[inherit]" so it matches the new-york-v4 variant and restores proper
max-height scrolling behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bd92224c-fb5d-4e3d-8755-734f846140e3
📒 Files selected for processing (1)
apps/v4/registry/new-york-v4/ui/scroll-area/ScrollArea.vue
Linked issue
Related to upstream issues:
Type of change
Description
ScrollArea doesn't scroll when the root has a max-height constraint (e.g. max-h-96) instead of an explicit height.
The ScrollAreaViewport has size-full which sets height: 100%. In CSS, height: 100% resolves against the parent's
explicit height property, not max-height. So when the root only has max-height, the viewport grows to its content size
and never scrolls.
Fix: Add max-h-[inherit] to the ScrollAreaViewport. This makes the viewport inherit the root's max-height constraint,
so overflow-y: scroll activates correctly. height: 100% continues to work for explicit height cases.
Reproduction:
Without fix: content overflows outside the popover, no scrolling. With fix: scrolls correctly.
N/A — reproducible with any ScrollArea using max-h-* instead of h-*.
Summary by CodeRabbit