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-7463] Response example tabs a11y #7464

Merged

Conversation

3ptmonster
Copy link
Contributor

@3ptmonster 3ptmonster commented Aug 16, 2021

  • Update tabs to use <button> elements instead of <a>
  • Add aria roles for tablist, tabs, and tabpanel to assist with screen-reader a11y
  • Replace ids with data-name attribute for tabpanels
  • Create test/e2e-cypress/tests/a11y directory and add cypress test 7463
  • Fix broken test swos-63

Description

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

Motivation and Context

This change is required because the implementation as it stands is not keyboard navigable, and is therefore broken for keyboard-only users.

Fixes #7463 well as a high-priority item on this larger a11y open issue list.

How Has This Been Tested?

Environment
OS: macOS 11.5 Big Sur
Browser(s):

  • Chrome v92.0.4515.131
  • Safari v14.1.2
    Node version: 14.15.0
    npm version: 6.14.8

I forked the master branch and ran the petstore in my local environment to test the changes. The testing consisted of keyboard-only navigation through the petstore with the macOS VoiceOver utility in both Chrome and Safari. I pressed the Tab key until I was focused on the button labeled Example Value, then pressed Tab a second time to ensure the focus changed to the button labeled Model. Once those were satisfied, the third Tab press was done to test that focus changed to the tabpanel.

Screenshots (if appropriate):

Screen Shot 2021-08-16 at 10 26 53 AM

Screen Shot 2021-08-16 at 10 27 08 AM

Screen Shot 2021-08-16 at 10 27 24 AM

Checklist

My PR contains...

  • No code changes (src/ is unmodified: changes to documentation, CI, metadata, etc.)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fixes (non-breaking change which fixes an issue)
  • Improvements (misc. changes to existing features)
  • Features (non-breaking change which adds functionality)

My changes...

  • are breaking changes to a public API (config options, System API, major UI change, etc).
  • are breaking changes to a private API (Redux, component props, utility functions, etc.).
  • are breaking changes to a developer API (npm script behavior changes, new dev system dependencies, etc).
  • are not breaking changes.

Documentation

  • My changes do not require a change to the project documentation.
  • My changes require a change to the project documentation.
  • If yes to above: I have updated the documentation accordingly.

Automated tests

  • My changes can not or do not need to be tested.
  • My changes can and should be tested by unit and/or integration tests.
  • If yes to above: I have added tests to cover my changes.
  • If yes to above: I have taken care to cover edge cases in my tests.
  • All new and existing tests passed.

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
- Remove aria-controls and aria-labelledby attributes along with the removal of ids
- Replace ids with data-name attribute for tabpanels
- Add cypress test 7463 and update swos-63
@char0n
Copy link
Member

char0n commented Aug 17, 2021

Thanks @3ptmonster;

We'll get into review ASAP. I was wandering - how it is that you're familiar with swos-63 ?

@3ptmonster
Copy link
Contributor Author

@char0n I was not familiar with it at first, but before creating the PR I ran all the tests and it was the only one to fail, so I looked into it before making the appropriate updates.

Copy link
Member

@char0n char0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

Please have a look at my review comments and let me know if they make sense.

This PR changes package-lock.json file; there's not reason why it should. Can you please remove changes to packe-lock.json from this PR? Thanks!

src/core/components/model-example.jsx Show resolved Hide resolved
src/core/components/model-example.jsx Outdated Show resolved Hide resolved
src/core/components/model-example.jsx Outdated Show resolved Hide resolved
src/core/components/model-example.jsx Outdated Show resolved Hide resolved
src/core/components/model-example.jsx Outdated Show resolved Hide resolved
test/e2e-cypress/tests/bugs/7463.js Outdated Show resolved Hide resolved
@Cgfor3
Copy link

Cgfor3 commented Aug 19, 2021

This PR changes package-lock.json file; there's not reason why it should. Can you please remove changes to packe-lock.json from this PR? Thanks!

  • Restore package-lock file from master branch

- Move tabs test file to tests/a11y directory
@3ptmonster 3ptmonster requested a review from char0n August 30, 2021 20:02
@char0n
Copy link
Member

char0n commented Sep 9, 2021

@Cgfor3 thanks for the additional effort and work!

I'll re-review during tomorrow.

Copy link
Member

@char0n char0n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functionality and test looks good! Thanks for your work on this. Before we move to merging I'll like to simplify this code if we can.

Consider my further comments and nitpicks

@char0n
Copy link
Member

char0n commented Sep 16, 2021

@3ptmonster this has been a great experience collaborating with! Hope you'll keep those a11n PR comming ;]

Waiting for tests to pass and going for a merge

@3ptmonster
Copy link
Contributor Author

@3ptmonster this has been a great experience collaborating with! Hope you'll keep those a11n PR comming ;]

Waiting for tests to pass and going for a merge

I appreciate all the help and feedback! Definitely looking forward to collaborating again.

@char0n
Copy link
Member

char0n commented Sep 20, 2021

@3ptmonster we have a visual regression after this PR described here: #7517

@Cgfor3
Copy link

Cgfor3 commented Sep 20, 2021

@3ptmonster we have a visual regression after this PR described here: #7517

Are there documented design requirements for that call-to-action element? What would be the best way for me to assist with this regression?

@char0n
Copy link
Member

char0n commented Sep 21, 2021

Are there documented design requirements for that call-to-action element?

After the changes we made, the ideal outcome would be if the UI looked the same. I did tested it locally, but unfortunately I forgot to open the changes in Incognito Window; so the cache kicked in.

What would be the best way for me to assist with this regression?

It's being handled in #7517 quite well. This was just FYI.

char0n pushed a commit that referenced this pull request Sep 21, 2021
…nks (#7517)

Fixes small visual regression introduced in #7464.

Refs #7464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug/Response Tabs not keyboard navigable
3 participants