reactjs / reactjs/react.dev

[Bug]: Sidebar dropdown does not close when the arrow is clicked again

未關閉 適合新手
#8,618 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

bug: unconfirmed
主要語言
JavaScript
星號
11.8k
分支
7.9k
平均合併
1 天 11 小時
30 天內合併 PR
11

描述

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

  1. Go to any documentation page with an expanded sidebar section, such as https://react.dev/learn/installation.
  2. Locate the left sidebar navigation.
  3. Click on the downward-facing arrow next to the currently active/expanded section (e.g., "Installation").
  4. 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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

https://react.dev/learn/installation 的側邊欄開始,追蹤文件網站中已展開區段的箭頭點擊處理常式。在 Chrome 中重現此行為,然後確認再次點擊箭頭會收合該區段,同時導覽和目前頁面內容仍能正常運作。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, react
領域
documentation, frontend
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
活躍
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。