patternfly-org
patternfly-org copied to clipboard
Bug - Navigation sidebar doesn't close when item is selected
Describe the problem When the left navigation is collapsible on narrower screens, the navigation should slide closed again after a selection is made.
Expected behavior When the user selects an item from the navigation, the sidebar containing the navigation should slide closed.
Screenshots https://github.com/user-attachments/assets/2ba63dd7-1558-4bd1-9afa-8c6b58060ccf clarification: the example above is the current behavior; desired behavior is for the left nav to slide shut after an item is selected (leaf nodes only - not if you are expanding a section)
Hi! @srambach , I’d like to take this issue and work on it for Hacktoberfest. Please assign it to me.
Regarding the behavior change, I plan to update the sidebar so that when a user selects a navigation item on narrower screens, the sidebar will automatically slide closed. This could involve listening to the selection event and triggering the collapse behavior programmatically.
Thanks!
Hi @srambach ! I’ve created a pull request that addresses this issue:
PR: Bug #4808: Navigation sidebar closes on item selection
This PR ensures that when a user selects a navigation item while the sidebar is collapsible, it automatically closes as expected.
Thanks!
Hey @Zaki-Mohd thanks. Are you seeing the correct behavior in the preview? To me it looks like the behavior hasn't changed; when i slide the left navigation out and then select an item, the left nav does not automatically collapse.