patternfly-org icon indicating copy to clipboard operation
patternfly-org copied to clipboard

Bug - Navigation sidebar doesn't close when item is selected

Open srambach opened this issue 1 month ago • 3 comments
trafficstars

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)

srambach avatar Sep 29 '25 17:09 srambach

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!

Zaki-Mohd avatar Sep 30 '25 10:09 Zaki-Mohd

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!

Zaki-Mohd avatar Oct 03 '25 16:10 Zaki-Mohd

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.

srambach avatar Oct 03 '25 18:10 srambach