azouaoui-med / react-pro-sidebar

React Pro Sidebar provides a set of components for creating high level and customizable side navigation
https://azouaoui-med.github.io/react-pro-sidebar/
MIT License
1.69k stars 414 forks source link

Unable to use Open and onOpenChange on SubMenu to "force" one Submenu opening at a time #180

Closed code4cake closed 1 year ago

code4cake commented 1 year ago

Description

This is might be a functionality question than a bug, I don't know if it is really a bug or maybe I'm not using those props correctly ?

I'm trying to use the open and onOpenChange to handle that only 1 accordion SubMenu is open at a time.
I want to use that same logic when I have nested Submenus as well.

But for some reason, this is not working.

To Reproduce You can come to this sandbox

Expected behavior I click a SubMenu1 and it opens, I click SubMenu2 and SubMenu1 closes. Only 1 level can be open at a time. This include nested SubMenus

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.