Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !35462

Made menubar with nested dropdowns keyboard accessible based on W3's menubar design pattern

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/FluffyPorkBuns/main into main Dec 03, 2021
  • Overview 4
  • Commits 7
  • Pipelines 0
  • Changes 44

Created by: FluffyPorkBuns

Made it so a menubar with nested dropdowns will be keyboard accessible according to W3's menubar design pattern: https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html

  • Top-level dropdowns can be navigated through with the left and right arrows or tab keys.
  • Top-level dropdowns are opened with spacebar, down arrow, or enter key. First item in dropdown is selected automatically.
  • Dropdowns can be navigated with up and down arrows or tab key and selection wraps from beginning to end / end to beginning.
  • Sub-dropdowns can be opened with right arrow, spacebar, or enter key. First item in sub-dropdown is selected automatically.
  • Dropdowns and sub-dropdowns can be closed with the left arrow or escape key. Only the currently open dropdown or sub-dropdown will close (will not bubble up to all parents and close everything). The item that opened that dropdown is selected automatically.
  • Dropdown and sub-dropdown links can be opened with spacebar or enter key and closes entire menubar.
  • Only one dropdown can be open at a time in a menubar.
  • Fixed a bug where the spacebar didn't open dropdown items (dropdown.js line 39).

I'm guessing my changes may not fit the existing code gracefully (this was created for a specific menubar for a project and I'm not that familiar with this codebase) but I'm interested in hearing what others think about adding these accessibility features to the existing dropdown code.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/FluffyPorkBuns/main