Skip to content

Accessibility fixes for copy button - #313

Merged
wparad merged 7 commits into
Authress-Engineering:release/2.4from
ahamelers:accessibility/copy-button
Jul 20, 2026
Merged

Accessibility fixes for copy button#313
wparad merged 7 commits into
Authress-Engineering:release/2.4from
ahamelers:accessibility/copy-button

Conversation

@ahamelers

@ahamelers ahamelers commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Currently, there are several accessibility issues with the copy button:

  1. The function works in such a way that the focus is removed from the button, stranding the keyboard/screen reading user
  2. If there are multiple copy buttons on the same page, they all have the same text and so cannot be discerned from one another by the screen reader user
  3. The 'copied' success status update is not announced to the screen reader user.

This PR fixes these issues by:

  1. Updating the copy function to use the clipboard API and no longer change focus
  2. Adding an aria-label to each copy button to make it clear to the screen reader user what they are copying
  3. Updating an aria status element so the 'copied' success status update is announced

Also note that scrollable regions on a page must be able to receive tab focus, and stuff that's focussable should be labeled and given a role if possible, so this PR also adds a label, role, and tabindex to the scrollable region that the copy button copies.

Comment thread src/components/syntax-highlighter.js Outdated
Comment thread src/utils/common-utils.js Outdated
Comment thread src/components/api-request.js Outdated
@ahamelers
ahamelers requested a review from wparad July 20, 2026 15:43
@wparad
wparad merged commit bd1c64a into Authress-Engineering:release/2.4 Jul 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants