fix(theme): improve accessibility of api explorer controls#1325
Open
emroussel wants to merge 2 commits intoPaloAltoNetworks:mainfrom
Open
fix(theme): improve accessibility of api explorer controls#1325emroussel wants to merge 2 commits intoPaloAltoNetworks:mainfrom
emroussel wants to merge 2 commits intoPaloAltoNetworks:mainfrom
Conversation
emroussel
commented
Mar 7, 2026
...-theme-openapi-docs/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx
Show resolved
Hide resolved
emroussel
commented
Mar 7, 2026
packages/docusaurus-theme-openapi-docs/src/theme/ApiExplorer/Request/_Request.scss
Show resolved
Hide resolved
Member
|
Hi @emroussel, thanks for the contribution! Only one minor nit (see below) before we can merge:
Passing htmlFor to a is not valid HTML and may cause a TS error depending on the tsconfig. A safer pattern would be: |
Author
|
@sserrata good catch, should be fixed now |
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