Replies: 3 comments
-
I completely agree—this is a crucial improvement. Typically, the classes or refs passed to the root component aren’t as necessary as those applied to the viewport. Ideally, these should be forwarded directly to the viewport by default. This change would make the base component much more flexible and practical for most use cases. And so the solution you've provided is even better and more flexible, it's the only component where I often use the radix primite directly for those reasons. |
Beta Was this translation helpful? Give feedback.
-
@Rafirvan you are a lifesaver! Thank you!! |
Beta Was this translation helpful? Give feedback.
-
Just updated the code slightly to reflect more recent changes. would definitely be nice for this to be an official feature, if anybody wants to put this on a pull request go ahead |
Beta Was this translation helpful? Give feedback.
-
Hello there, i want to share a component edit i have been using. a conditionally invoked access to Radix's scrollAreaViewport component. scrollAreaViewport gives access to "onScroll" prop, and some important css like scroll snapping and overscroll behaviour among others.
now you can either use
<ScrollArea className="...">{children}</ScrollArea>
or
<ScrollArea className="..."> <ScrollAreaViewport className="..."> {children} </ScrollAreaViewport> </ScrollArea>
to access viewport props and classes.
if there is any bugs related to this please report back here. Cheers.
Beta Was this translation helpful? Give feedback.
All reactions