Skip to content

a11y: Curl command's copy to clipboard button has accessibility issues #9584

Description

Q&A (please complete the following information)

  • OS: [e.g. macOS] Windows 10
  • Browser: [e.g. chrome, safari] Chrome
  • Version: [e.g. 22] 121
  • Method of installation: [e.g. npm, dist assets] npm
  • Swagger-UI version: [e.g. 3.10.0] Swagger UI React 5.11.3
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0] OpenAPI 3.0

Content & configuration

Basic/ default

Describe the bug you're encountering

We are using a tool called Sort Site to evaluate our site for 508 accessibility compliance. It is flagging for the "copy to clipboard" element that "This "button" element is empty and has no accessible name. A programmatically determined name allows screen readers to tell users what the control does."
Violates WCAG 2.0 A 4.1.2 https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html
This error is on the button (with no class) which is contained in the div with class "copy-to-clipboard"

To reproduce...

Open the pane for a method such as POST. Click Try It Out. Click Execute. Scroll down to see the Curl command - there is a small Copy to Clipboard icon in the bottom right corner.

Expected behavior

The button should identify itself

Screenshots

Here's the area on the screen
image

Here's the Sort Site error detail:
image

Additional context or thoughts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions