Skip to content

Make LeptonX sidebar collapse/expand control keyboard accessible #24077

@jtasko

Description

@jtasko

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

Problem Sidebar relies on hover; no keyboard re-expand path.

Proposed solution: a persistent, accessible toggle button with ARIA and keyboard handling; icon swaps by state.

Acceptance criteria: WCAG 2.1 AA—keyboard operable and correct aria-expanded; no regression to hover behavior.

Describe the solution you'd like

Always-render a real button for the sidebar toggle (not hover-only), with:

  • type="button", tabindex=0 (native button already focusable)
  • aria-label bound to the action (Expand navigation / Collapse navigation)
  • aria-expanded bound to the current sidebar state
  • Enter/Space to toggle

Icon swap based on state:

  • Expanded: show “collapse” icon (e.g., bi-filter-left)
  • Collapsed: show “expand” icon (e.g., bi-filter-right)

Keep hover-trigger behavior, but not as the only way; the button must be present and focusable in both states.

Expose the state through the theme’s layout service so existing CSS/behavior stays in sync.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions