shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
75.64k stars 4.75k forks source link

[bug]: Multiple DropdownMenu in sidebar causes freeze on mobile screen #5642

Open PanThomas opened 1 month ago

PanThomas commented 1 month ago

Describe the bug

https://ui.shadcn.com/blocks#sidebar-07

If you open multiple dropdown menus on a phone screen and close the sidebar, the whole app freezes.

Affected component/components

Sidebar

How to reproduce

  1. Visit https://ui.shadcn.com/blocks#sidebar-07
  2. Click on the phone screen.
  3. Open the sidebar.
  4. Open the dropdown menu in the company switcher (Acme).
  5. Open the profile dropdown menu (shadcn at the bottom).
  6. Click away to close the sidebar.
  7. Now, you can't do anything; you can't even reopen the sidebar.

Codesandbox/StackBlitz link

https://ui.shadcn.com/blocks#sidebar-07

Logs

No response

System Info

google chrome, windows 11

Before submitting

joeydewaal commented 4 weeks ago

+1, I have the same problem

PanThomas commented 4 weeks ago

+1, I have the same problem

i fixed it like this:

const { isMobile, openMobile } = useSidebar()
if (!openMobile) {
    return null
  }

return ...

so far it works

DONG-8 commented 6 days ago

Are there any ongoing modification processes? If not, I would like to make improvements. Please give me comments