react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

Sidebar Dropdown Should Toggle When Clicking an Already-Selected Item

Open JayadityaGit opened this issue 1 month ago • 0 comments

When a user selects a sidebar item with nested routes, the dropdown expands as expected. However, clicking the same selected item again does nothing, even though users naturally expect it to collapse. This leads to:

Reduced control over sidebar visibility

Unnecessary scrolling when sections cannot be collapsed

Lower consistency with typical documentation UI behavior

Expected Behavior

Clicking an already-selected sidebar item should toggle the visibility of its dropdown.

Clicking a non-selected item behaves normally (navigate + expand).

When navigating away, the collapsed state should reset automatically so the correct item appears expanded by default.

JayadityaGit avatar Nov 19 '25 07:11 JayadityaGit