-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The issue is in the SidebarMenuButton component, in this line:
render: !tooltip ? render : TooltipTrigger,When there's a tooltip, it replaces the render prop with TooltipTrigger, losing the Link entirely.
Workaround: Change the render logic to always respect the render prop, then wrap with TooltipTrigger using composition:
const comp = useRender({
// ...
render, // Always use the render prop
// ...
})
return (
<Tooltip>
<TooltipTrigger render={comp} />
<TooltipContent ... />
</Tooltip>
)This preserves the composition chain: TooltipTrigger → Link → button content.
Affected component/components
Sidebar (SidebarMenuButton)
How to reproduce
- Add a SidebarMenuButton with both
renderandtooltipprops:
<SidebarMenuButton
tooltip={{ children: "Dashboard" }}
render={<Link href="/dashboard" />}
>
<LayoutGrid />
<span>Dashboard</span>
</SidebarMenuButton>- Click on the sidebar menu item
- Expected: Navigation to /dashboard
- Actual: Nothing happens - the button is not clickable as a link
Codesandbox/StackBlitz link
No response
Logs
System Info
- shadcn/ui: latest (with Base UI style)
- @base-ui/react: 1.0.0
- React: 19
- Browser: Brave
- OS: macOSBefore submitting
- I've made research efforts and searched the documentation
- I've searched for existing issues
mfainman-churned and aaronmcadam
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working