-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[bug]: Using Drawer with snap points #6891
Comments
@hadnet Can you provide the code of how you were using |
@hadnet Usually, your first When the first
|
@SameerJS6, after digging a little, I found that the problem is on line 36 https://github.com/shadcn-ui/ui/blob/12d4cf2ab0caefec5d6232e6c32220a8e62d73c4/apps/v4/registry/new-york-v4/ui/drawer.tsx#L61C145-L61C194 Specifically the |
@hadnet That's Interesting because I am not using the Anyway, it's good to see that in v4, they are accounting for styles for different directions, which wasn't the case for the normal Before the v4 update: Drawer Content const DrawerContent = React.forwardRef<
React.ElementRef<typeof DrawerPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
>(({ className, children, ...props }, ref) => (
<DrawerPortal>
<DrawerOverlay />
<DrawerPrimitive.Content
ref={ref}
className={cn(
"fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
className
)}
{...props}
>
<div className="mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" />
{children}
</DrawerPrimitive.Content>
</DrawerPortal>
)) |
Describe the bug
The Drawer component has a bug when trying to use it with the
snapPoints
,activeSnapPoint
, andsetActiveSnapPoint
props. The Drawer isn’t visible, it doesn’t show up, even though it’s in the DOM. But when using the Drawer through the Vaul package, it works perfectly. I think it's something related to DrawerContent component.Affected component/components
Drawer
How to reproduce
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: