DropdownMenu: First menu remains open when clicking on the second menu button #5898
aymericfontaine
started this conversation in
General
Replies: 1 comment
-
I think this is expected behavior, since both menus don't know anything about each other. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I’m encountering a strange behavior with the DropdownMenu component from shadcn/ui in my Next.js project.
Here’s the issue:
1. When I open the first menu and click outside of it, the menu closes as expected.
2. However, when I open the first menu and then click the button to open the second menu, the first menu stays open, and both menus are visible.
This seems like unintended behavior since I would expect the first menu to close automatically when opening another one.
Here’s a simple example replicating the issue:
• Two DropdownMenu components are placed side by side.
• Clicking on the button for the second menu doesn’t close the first menu.
Is this the intended behavior of the DropdownMenu component? If not, could this be addressed in a future update? Or is there a recommended way to handle such a case?
Thanks in advance! 😊
Beta Was this translation helpful? Give feedback.
All reactions