Add accessible names and WCAG checks for buttons#10908
Open
moskvin wants to merge 5 commits into
Open
Conversation
Author
|
Hi @robert-hebel-sb - sorry to ping directly, I noticed you've been merging most of the recent PRs and was hoping you (or someone you'd suggest) could take a look at this one when you have a moment. It's a small, self-contained accessibility change:
Happy to rebase, split it up, or adjust the wording on the labels if any of that would make the review easier. Thanks for your time! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds accessible names and tooltips to Swagger UI icon buttons
This updates copy controls for:
The labels are applied directly to the interactive
<button>elements. Matchingtitleandaria-labelvalues are also applied to the.copy-to-clipboardwrappers where applicable, preserving the existing wrapper styling while giving assistive technology a programmatic name for the actual control.Motivation and Context
Some copy-to-clipboard controls render as empty buttons without accessible names. Screen readers and accessibility scanners cannot determine what those controls do.
This fixes the cURL copy-button issue reported in:
Fixes #9584
It also addresses the copy-to-clipboard portion of the broader accessibility issue:
Relates to #10699
This change removes the need for downstream runtime workarounds such as
ruby-grape/grape-swagger-rails#163, where.copy-to-clipboardelements were being labeled after render with aMutationObserver.How Has This Been Tested?
Tested in the local Swagger UI repository with Node/npm project tooling.
Commands run:
ESLint completed with no errors. It still reports existing
react/jsx-no-bindwarnings in unchanged code paths.Result:
Screenshots (if appropriate):
N/A. This is an accessibility markup change and does not intentionally change the visual UI.
Checklist
My PR contains...
src/is unmodified: changes to documentation, CI, metadata, etc.)package.json)My changes...
Documentation
Automated tests