[Bug]: Sidebar dropdown does not close when the arrow is clicked again
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.8k
- Forks
- 7.9k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 11
Description
Summary
In the left sidebar navigation, when a section with sub-items is expanded (for example, "Installation"), clicking its downward-facing arrow again does not collapse the section. Users naturally expect an expand/collapse toggle arrow to work in both directions — even if this is intentional (e.g., to keep the active page's context visible), it hurts the UX since users assume clicking again will close the dropdown.
Page
https://react.dev/learn/installation
Details
To Reproduce
- Go to any documentation page with an expanded sidebar section, such as https://react.dev/learn/installation.
- Locate the left sidebar navigation.
- Click on the downward-facing arrow next to the currently active/expanded section (e.g., "Installation").
- Notice that the section does not collapse as expected.
Expected behavior
Clicking the dropdown arrow of an already expanded section should toggle it back to a collapsed state.
Desktop:
- OS: Windows
- Browser: Chrome
Additional context
Observed on the main react.dev documentation site. Fixing this would make the navigation feel more intuitive and aligned with standard UI patterns for accordions/dropdowns.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the sidebar on https://react.dev/learn/installation and trace the click handler for the expanded section's arrow in the documentation site. Reproduce the behavior in Chrome, then verify that clicking the arrow again collapses the section while navigation and active-page context still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- documentation, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100