-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to control the overflow-x of Scroll-area #2090
Comments
The issue you're experiencing is due to the overflow-hidden class on the ScrollAreaPrimitive.Root component. This class is hiding any content that goes outside the boundaries of the component, including your shadow. To fix this, you can remove the overflow-hidden class. However, this might cause other layout issues depending on the rest of your code. If you still want to hide the overflow in the y-direction but show it in the x-direction, you can use the overflow-x-auto and overflow-y-hidden classes instead. @/components/ui/scroll-area.tsx <ScrollAreaPrimitive.Root
ref={ref}
className={cn("relative overflow-x-auto overflow-y-hidden", className)}
{...props}
> In this code, overflow-x-auto will make the x-direction overflow scrollable, and overflow-y-hidden will hide the y-direction overflow. This should allow your shadow to be visible on the sides. |
This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you. |
I'm having the same issue |
Same here 😞 |
Im having the same issue 😭 |
Here's my code that resolved the issue: <ScrollArea className="[&>div>div[style]]:!block"> The issue radix-ui/primitives#926 might help to solve this issue. |
use this incase overflow y is hidden className="[&>div>div[style]]:!block h-full" |
please provide screenshot of the code @Cranbaerry |
Here's a snippet of the code, the ScrollArea is inside an AlertDialogContent (popup) and a form <AlertDialogTitle className="mb-2">Data Diri</AlertDialogTitle>
<ScrollArea className="!mb-2 h-[calc(100vh-10rem)] sm:h-96 px-1">
<p className="mb-2">Mohon isi data diri Anda dengan lengkap dan benar.</p>
{/* Full Name */}
<FormField
control={form.control}
name="fullName"
render={({ field }) => {
return (
<FormItem className="mb-2">
<FormLabel>
Nama Lengkap
</FormLabel>
<FormControl>
<Input
placeholder="John Doe"
{...field}
value={field.value || ''}
onChange={e => {
field.onChange(e.target.value);
form.trigger('fullName');
}}
required
/>
</FormControl>
<FormMessage />
</FormItem>
);
}}
/>
</ScrollArea> |
I'm having an issue making the overflow-x of scroll area visible. I've got some cards within a vertically scrollable area, the cards has a hover effect that has a large shadow, the shadow is cut from the x sides! I'm trying to figure out how I can make overflow-x visible with no success! Tried to add a custom class and try to customize it with custom css but with no success.
The text was updated successfully, but these errors were encountered: