Bug - PageSidebar - collapsed sidebar is aria-hidden but its navigation links stay in the tab order

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

維護者通常 1 天內回覆

@Sophran-fbj 已經在處理了。

開始於 2026年11月16日。

  • #12720 來自 @Sophran-fbj —— 未關閉

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
74/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
react, typescript

研究方向

從 packages/react-core/src/components/Page/PageSidebar.tsx 開始,追蹤受管理的側邊欄如何處理其收合狀態和可聚焦的後代元素。使用一個在 xl breakpoint 以下包含 Nav 的 PageSidebar 重現此問題,接著檢查側邊欄處於 aria-hidden 狀態時,收合導覽中的連結無法取得鍵盤焦點。

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

描述

Describe the problem
When the Page sidebar collapses, PageSidebar renders aria-hidden={!sidebarOpen} (current main, packages/react-core/src/components/Page/PageSidebar.tsx), but nothing removes its descendants from the focus order (no inert, no tabindex="-1", and the content stays rendered). Keyboard users can Tab into a region that assistive technology is told does not exist (axe aria-hidden-focus, WCAG 4.1.2).

Observed in Keycloak 26.8.1's Admin Console (PatternFly 5 Page / PageSidebar with a nav), below the xl breakpoint where the sidebar collapses (320 and 390 CSS px): the collapsed sidebar is aria-hidden="true" while its navigation links (#nav-item-realms, #nav-item-clients, … #nav-item-user-federation) remain in the tab order.

How do you reproduce the problem?

  1. Render a Page with a managed PageSidebar containing a Nav with links.
  2. Narrow the viewport below the xl breakpoint so the sidebar collapses.
  3. Run axe, or press Tab from the masthead and watch focus enter the hidden sidebar.

Expected behavior
A collapsed, aria-hidden sidebar is also removed from the focus order (inert on the sidebar, tabindex="-1" on its focusable descendants, or not rendering the content while collapsed).

Is this issue blocking you?
No. Workaround: none applied; the affected product is Keycloak's Admin Console.

What is your environment?
macOS, Chromium-based browser, PatternFly 5 as bundled in Keycloak 26.8.1; aria-hidden={!sidebarOpen} without inert is still present on main.

Any other information?
Found with axe while testing a themed Keycloak 26.8.1 Admin Console at narrow widths.


Jira Issue: PF-4746


Jira Issue: FELT-4741

主要語言
TypeScript
星號
859
分支
395
平均合併
3 天 13 小時
30 天內合併 PR
15

環境準備

從這裡開始

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

patternfly/patternfly-react 的其他 Issue

查看 patternfly/patternfly-react 的全部 Issue

相似的 Issue

更多 TypeScript Issue

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

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