Skip to content

fix(GlDropdown): Make dropdown more accessible

Coung Ngo requested to merge cngo-make-dropdown-more-accessible into master

What does this MR do?

This MR makes GlDropdown more accessible. The impetus was the use case where we want to show a dropdown with a vertical ellipsis and no text—currently in this scenario there is no accessible name for the dropdown button.

This MR:

  • Adds the ability to make the dropdown button text visually hidden
  • Hides icons from screen readers as they are visual decoration
  • Adds a story for an icon only dropdown
  • Adds more Storybook knobs for the dropdown component

The naming of the text-sr-only prop was inspired by how the Bootstrap Vue modal component implements an sr-only title: https://bootstrap-vue.org/docs/components/modal#comp-ref-b-modal-props

Screenshots

before after
Screenshot_2020-10-20_at_5.56.35_pm Screenshot_2020-10-20_at_5.58.01_pm

Does this MR meet the acceptance criteria?

Conformity

  • Code review guidelines.
  • GitLab UI's contributing guidlines.
  • If it changes a Pajamas-compliant component's look & feel, the MR has been reviewed by a UX designer.
  • If it changes GitLab UI's documentation guidelines, the MR has been reviewed by a Technical Writer.
  • If the MR changes a component's API, integration MR(s) have been opened in the following projects to ensure that the @gitlab/ui package can be upgraded quickly after the changes are released:
  • Added the ~"component:*" label(s) if applicable.

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • Security reports checked/validated by a reviewer from the AppSec team

Merge request reports

Loading