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
  • !15263

Add keyboard support to dropdown.js

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/gerardkcohen/dropdown-keyboard into master Dec 02, 2014
  • Overview 0
  • Commits 5
  • Pipelines 0
  • Changes 17

Created by: gerardkcohen

For peer review only: Looking for feedback

This PR adds proper keyboard support to dropdown.js, based on keyboard interaction rules from WAI-ARIA Authoring Practices for Menu

Some highlights:

  • Enter, Space, and Up/ Down Arrow keys will display menu, placing focus on first menu item
  • Up/ Down arrow keys cycle focus through items
  • Tab, Esc, and Left Arrow keys dismiss menu, placing focus back on trigger
  • Letter keys [a-z] cycle focus through items that begin with that letter

Also updated are all dropdown examples to encourage good a11y habits.

Additions:

  • Add role="separator" for divider items
  • Add role="heading" for header items
  • Add aria-disabled="true" to disabled items

Once this has been reviewed, I can add proper unit tests.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/gerardkcohen/dropdown-keyboard