tailwindlabs / tailwindui-issues

Bug fixes and feature request tracking for Tailwind UI.
233 stars 4 forks source link

Catalyst: SidebarLayout overflow #1599

Closed fouteox closed 2 months ago

fouteox commented 2 months ago

What component (if applicable)

Describe the bug If you try to put many items, the overflow is not correct on mobile.

To Reproduce Steps to reproduce the behavior: Add several items until it takes up the full height.

Expected behavior Items should not overflow.

Screenshots

Capture d’écran 2024-06-17 à 13 30 46

Browser/Device (if applicable)

Additional context No problem in desktop mode.

thecrypticace commented 2 months ago

Hey, thanks for pointing this out — I've fixed this in Catalyst and the updated version is available on Tailwind UI.

You can either download a new copy of the components or you can add min-h-0 to the <Sidebar> component in sidebar.tsx like so:

export function Sidebar({ className, ...props }: React.ComponentPropsWithoutRef<'nav'>) {
-  return <nav {...props} className={clsx(className, 'flex h-full flex-col')} />
+  return <nav {...props} className={clsx(className, 'flex h-full min-h-0 flex-col')} />
}

Hope that helps! ✨