swagger-api / swagger-api/swagger-ui

a11y: Example table: Hidden scrollable content cannot be scrolled using the keyboard

Open
#9,582 0 comments 24 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

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 configuration

Describe the bug you're encountering

We are using a tool Sort Site to evaluate our site for accessibility issues. it is flagging the Request body Example table: "Hidden scrollable content cannot be scrolled using the keyboard. Hidden scrollable content must either contain a focusable element like a link or have "tabindex=0" set. This allows keyboard users to tab to the hidden content and scroll using the arrow keys. " Violates wCAg 2.0 A 2.1.1 https://www.w3.org/WAI/WCAG21/Understanding/keyboard.html
This is happening on element "pre" with class "body-param__example microlight"
Also on element "pre" with class "example microlight"

To reproduce...

Click to expand a method pane like a POST method, and see the example tab in the request body as well as in the responses section.

Expected behavior

No accessibility issue

Screenshots

Here's the area on the screen
image

Here's the Sort Site error:
image

Here's the Sort Site error down in the Responses section
image

Additional context or thoughts

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue by opening a POST method and inspecting the request-body and response example tabs, focusing on the pre elements with classes body-param__example microlight and example microlight. Trace those rendered examples to the responsible Swagger UI entry point. Done means keyboard users can reach and scroll the hidden content and the reported WCAG keyboard-accessibility warning is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.