Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/Response Tabs not keyboard navigable #7463

Closed
Cgfor3 opened this issue Aug 16, 2021 · 3 comments · Fixed by #7464
Closed

Bug/Response Tabs not keyboard navigable #7463

Cgfor3 opened this issue Aug 16, 2021 · 3 comments · Fixed by #7464
Assignees

Comments

@Cgfor3
Copy link

Cgfor3 commented Aug 16, 2021

Q&A (please complete the following information)

  • OS: macOS 11.5 Big Sur
  • Browser: Chrome
  • Version: 92.0.4515.131
  • Method of installation: npm
  • Swagger-UI version: 3.52.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Describe the bug you're encountering

The tabs implementation for Example Value and Schema/Model is not keyboard navigable.

To reproduce...

Steps to reproduce the behavior:

  1. Navigate to https://petstore.swagger.io/
  2. Select the endpoint labeled "Add a new pet to the store" under the "Pet" API.
  3. Press Tab 4 times to move through the elements in order
  4. On the fourth Tab press you will notice that the focused elements skip from the Try it out button to the Parameter content type dropdown, skipping the entire tabs section.

Expected behavior

The fourth tab press should focus on the element labeled Example Value. The next Tab press should focus the element labeled Schema/Model. Pressing Enter or Space should focus the unselected tab and update the visible tabpanel accordingly.

Screenshots

Tab focus to Example Value
Screen Shot 2021-08-16 at 10 26 53 AM

Tab focus to Model
Screen Shot 2021-08-16 at 10 27 08 AM

Tab focus to Tabpanel section
Screen Shot 2021-08-16 at 10 27 24 AM

Additional context or thoughts

Aria roles and other attributes will be necessary to accommodate screen reader a11y.

@char0n
Copy link
Member

char0n commented Aug 16, 2021

This is probably already detected in #7350

It has been agreed in #7350 that the original reporters will start working on small PRs fixing keyword navigation issues related to a11y. You can help us a well if you wish.

@Cgfor3
Copy link
Author

Cgfor3 commented Aug 16, 2021

@char0n I will be putting up a PR soon that addresses this issue. I would appreciate any and all feedback. Should I link the PR on the issue you mentioned as well for visibility?

@char0n
Copy link
Member

char0n commented Aug 16, 2021

I would appreciate any and all feedback

Of course, that's what we're here for ;]

Should I link the PR on the issue you mentioned as well for visibility?

Sure, the more cross-referenced we are the better.

char0n pushed a commit that referenced this issue Sep 17, 2021
- Update tabs to use <button> elements instead of <a>
- Add aria roles for tablist, tabs, and tabpanel
- Add aria attributes for additional a11y compliance and screen reader accessibility
- Replace ids with data-name attribute for tabpanels
- Add cypress test 7463 and update swos-63
- Move tabs test file to tests/a11y directory
- Rename test file to be more descriptive of what is being tested.
- Add id attributes to both tabs and tabpanels to leverage aria-controls and aria-labelledby attributes

Co-authored-by: Calvin Gonzalez <calvin.gonzalez@oddball.io>
Co-authored-by: Vladimir Gorej <vladimir.gorej@gmail.com>

Closes #7463
Refs #7350
@char0n char0n self-assigned this Sep 17, 2021
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 a pull request may close this issue.

2 participants