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

[a11y]: HeaderPanel requires an aria-label but Accessibility Checker complains if you have one. #13728

Closed
2 tasks done
kglickman opened this issue May 4, 2023 · 6 comments · Fixed by #13871
Closed
2 tasks done
Assignees
Labels

Comments

@kglickman
Copy link

Package

@carbon/react

Browser

No response

Operating System

No response

Package version

1.23.0

React version

16.14.0

Automated testing tool and ruleset

IBM Equal Access Accessibility Checker

Assistive technology

No response

Description

The tool is complaining about the aria-label in the HeaderPanel. If we remove it, the error goes away but we get an annoying error from checkPropTypes in the console saying it's required.
Warning: Failed prop type: HeaderPanel requires one of the following props: aria-label, aria-labelledby

image

WCAG 2.1 Violation

No response

Reproduction/example

Reproducible in the story book

Steps to reproduce

Look at the Accessibility section in the this url https://react.carbondesignsystem.com/?path=/story/components-ui-shell--header-base-w-actions-and-right-panel
https://react.carbondesignsystem.com/?path=/story/components-ui-shell--header-base-w-actions-and-right-panel

Code of Conduct

@btepe
Copy link

btepe commented May 24, 2023

We ran into the same issue. Using an aria-label without a role is not allowed. What is missing here is either an aria-role attribute on the div element used for the HeaderPanel or using a semantic HTML element instead of the generic div. I would suggest using an aside element.

@kglickman Until this is implemented in the library, we can set the aria-role="complementary". This seems like the most appropriate role according to MDN web docs.

@kglickman
Copy link
Author

I don't feel like either an "aside" element or a role of "complementary" are appropriate for a header. We would be silencing the Accessibility Checker but making the page more difficult to understand.

@btepe
Copy link

btepe commented May 24, 2023

@kglickman Perhaps the role and element I suggested are not the best choice, which ones would you suggest using?

When you look at the Carbon docs on the right header panel, it states that the right panel is an optional panel that shows additional system level actions or content associated with a system icon in the header. This means that it can contain a variety of interactive elements and plain information, so it isn't necessarily part of the navigation as are the other elements in the header. To me using a nav element doesn't seem like the right choice because of this.

@kglickman
Copy link
Author

We removed the aria label and the Accessibility Checker doesn't report an error anymore. This defect is about the prop being required, causing stacks in the console.

@tw15egan
Copy link
Collaborator

Needs to be backported to V10

@tw15egan tw15egan reopened this Aug 24, 2023
@github-project-automation github-project-automation bot moved this from ✅ Done to ⏱ Backlog in Design System Aug 24, 2023
@tw15egan tw15egan added the version: 10 Issues pertaining to Carbon v10 label Aug 24, 2023
@tw15egan
Copy link
Collaborator

Closed via #14517 , will be included in the next version of v10

@github-project-automation github-project-automation bot moved this from ⏱ Backlog to ✅ Done in Design System Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants