-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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]: NavigationMenu content does not show right undernith of a NavigationMenuItem #6136
Comments
Actually The max-w-screen-2xl class on the NavigationMenu was constraining the width and affecting the natural positioning behavior of the menu components. |
I have checked with your code . Still not working. I think the issue is in this navigation-menu component of shadcn. Specifically in here they set left-0 but it should be dynamic. const NavigationMenuViewport = React.forwardRef<
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
>(({ className, ...props }, ref) => (
<div className={cn("absolute left-0 top-full flex justify-center")}>
<NavigationMenuPrimitive.Viewport
className={cn(
"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",
className
)}
ref={ref}
{...props}
/>
</div>
));
NavigationMenuViewport.displayName =
NavigationMenuPrimitive.Viewport.displayName; |
@shadcn Could you please have a look at it? |
got you , tried a lot of times and still got the same issue think its linked with some other parameter |
Describe the bug
NavigationMenu content does not show right undernith of a NavigationMenuItem. It just sticks to left side.
Screencast.from.2024-12-20.01-39-29.webm
Affected component/components
NavigationMenu
How to reproduce
This is the component:
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Before submitting
The text was updated successfully, but these errors were encountered: