Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

[terra-navigation-side-menu] Accessibility Changes #2018

Merged
merged 15 commits into from
Feb 21, 2024

Conversation

MadanKumarGovindaswamy
Copy link
Contributor

@MadanKumarGovindaswamy MadanKumarGovindaswamy commented Feb 7, 2024

Summary

What was changed:

Audit Report Issues:

  1. Terra must provide a prop allowing consuming teams to provide a label that accurately describes the purpose of the navigation. Add an aria-label to the NAV element and apply consumer provided string.
  2. Add dashed border for focused item.
  3. Terra Navigation Side Menu that has a caret icon in its sub menu of contrast ratio 1.8:1 that does not meet the non text contrast ratio of 3:1. Implementing team(s) must ensure that any non-text content that conveys meaning to the user meet the 3:1 contrast ratio.
  4. Support Keyboard Navigation(Up and Down Arrow key)

Why it was changed:

This component does not commit accessibility criteria.

VO.mov

Testing

This change was tested using:

  • WDIO
  • Jest
  • Visual testing (please attach a screenshot or recording)
  • Other (please describe below)
  • No tests are needed

Reviews

In addition to engineering reviews, this PR needs:

  • UX review
  • Accessibility review
  • Functional review

Additional Details

This PR resolves:

UXPLATFORM-10196


Thank you for contributing to Terra.
@cerner/terra

@MadanKumarGovindaswamy MadanKumarGovindaswamy changed the title Update: A11y changes [terra-navigation-side-menu] Audit report Issues Feb 7, 2024
@MadanKumarGovindaswamy MadanKumarGovindaswamy changed the title [terra-navigation-side-menu] Audit report Issues [terra-navigation-side-menu] Accessibility Changes Feb 7, 2024
@MadanKumarGovindaswamy MadanKumarGovindaswamy marked this pull request as ready for review February 8, 2024 06:58
@@ -107,7 +107,7 @@
}

.chevron {
color: var(--terra-navigation-side-menu-item-selected-chevron-color, #909496);
color: var(--terra-navigation-side-menu-item-selected-chevron-color, #1C1F21);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this color provided by the design team?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

color contrast change reverted. Thanks
f257333

/* stylelint-disable-next-line max-nesting-depth */
.chevron {
color: var(--terra-navigation-side-menu-item-selected-focus-chevron-color, #909496);
color: var(--terra-navigation-side-menu-item-selected-hover-chevron-color, #1C1F21);
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this color provided by the design team?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

color contrast change reverted. Thanks
f257333

@saket2403
Copy link
Contributor

Please add a wdio test to verify the up and down arrow key navigation and also update the test files with the new ariaLabel prop.

@@ -36,16 +36,19 @@
--terra-navigation-side-menu-item-selected-before-background-image: none;
--terra-navigation-side-menu-item-selected-background-size: auto;
--terra-navigation-side-menu-item-selected-border-left: 0.5rem solid #007cc3;
--terra-navigation-side-menu-item-selected-chevron-color: #909496;
--terra-navigation-side-menu-item-selected-chevron-color: #1C1F21;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. this variable is not used any more. Removed . Thanks
3017b29

--terra-navigation-side-menu-item-selected-color: #1c1f21;
--terra-navigation-side-menu-item-selected-focus-background-color: #f4f4f4;
--terra-navigation-side-menu-item-selected-focus-chevron-color: #909496;
--terra-navigation-side-menu-item-selected-focus-chevron-color: #1C1F21;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to revert this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. this variable is not used any more. Removed . Thanks
3017b29

This reverts commit 3017b29.
// To add focus to the first sub menu item
if (node && this.needsFocus) {
const subMenuNodes = node.querySelectorAll('[data-menu-item]');
if (subMenuNodes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if (subMenuNodes) {
if (subMenuNodes && subMenuNodes.length) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Thanks
5382cb3

@sugan2416
Copy link
Contributor

With VO, unable to navigate items with arrow keys, tab works.
aria-label added in this example: https://github.com/cerner/terra-framework/pull/2018/files#diff-645e1bb824a065f0d02a73ac27b999151d5d51c76124df924b1d19553766de95R63 is not announced.
Can you verify this in both SR

@github-actions github-actions bot temporarily deployed to preview-pr-2018 February 20, 2024 13:53 Destroyed
@rahulkumar8cs
Copy link

+1 for the current a11y changes.
We need to fix the focus behaviour navigation side menu of back button in new jira which you created. Thank you

@saket2403 saket2403 merged commit c44f6ee into main Feb 21, 2024
22 checks passed
@saket2403 saket2403 deleted the UXPLATFORM-10196-NavigationSideMenu branch February 21, 2024 09:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants