fix(theme): improve accessibility of api explorer controls#1325
Open
emroussel wants to merge 1 commit intoPaloAltoNetworks:mainfrom
Open
fix(theme): improve accessibility of api explorer controls#1325emroussel wants to merge 1 commit intoPaloAltoNetworks:mainfrom
emroussel wants to merge 1 commit intoPaloAltoNetworks:mainfrom
Conversation
emroussel
commented
Mar 7, 2026
| <button | ||
| className="openapi-explorer__delete-btn" | ||
| onClick={handleDeleteItem(item)} | ||
| aria-label="Delete" |
Author
There was a problem hiding this comment.
The <title>Delete</title> below wasn't read by screen readers because the parent <svg> has aria-hidden="true". aria-label on the <button> is a more reliable way to set this label for screen readers.
emroussel
commented
Mar 7, 2026
| background-color: transparent; | ||
| text-transform: inherit; | ||
| font-weight: inherit; | ||
| font-size: inherit; |
Author
There was a problem hiding this comment.
This overwrites default button browser styles so that these buttons look the same as before my changes in the demo. Worth noting that it could conflict with style overwrites depending on people are loading/applying them, in which case this element could stay as a span instead of a button like I mentioned in the "types of changes" in the PR description.
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.
Description
Fix a couple of accessibility violations in the openapi explorer:
<FormLabel>component to do this since I couldn't find a good way to make this work with the existing<FormItem>component. Some spots didn't render a visual label so I just set anaria-labeloraria-labelledbyas to not introduce any UI changes.<details>/<summary>so the ideal fix here would probably be to do the same, but I wanted to keep markup changes to a minimum so I added the required aria attributes to make it accessible to screen readers instead.outline: nonefrom the delete and add item buttons in array param form items: Removing the outline makes it so that users who navigate the site using a keyboard cannot know what is currently being focused.Motivation and Context
Closes #1265
How Has This Been Tested?
Tested the openapi explorer section of the pet store demo running locally with keyboard navigation, screen reader, and mouse. Compared markup and styles with previous version (without my changes) to make it looks the same and that markup is not changed significantly.
Screenshots (if appropriate)
N/A
Types of changes
Note: some of these fixes change the markup/styles slightly, for example I updated a clickable
<span>to use a<button>instead since that's better semantics, but it could also be kept as a span with attributes likerole="button"andtabindex="0"instead if you would rather keep markup changes to an absolute minimum. Some changes are probably inevitable though.Checklist