question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Accessibility, DAP Violation] ariaLabel property unused on Carbon Dropdown for underlying button

See original GitHub issue

What package(s) are you using?

  • carbon-components
  • carbon-components-react

Specifically (ish), carbon-components": “^10.6.1” and “carbon-components-react”: “^7.6.1”,

Detailed description

For reference see https://github.com/tektoncd/dashboard/issues/524 - looks like the ariaLabel property isn’t being picked up when added to the SideNavMenuItem component, e.g. with

          <SideNavMenuItem
            element={NamespacesDropdown}
            id="sidenav-namespace-dropdown"
            selectedItem={{
              id: namespace,
              text: namespace,
              ariaLabel: namespace
            }}
            showAllNamespaces
            onChange={this.selectNamespace}
          >

Is this issue related to a specific component?`

Yeah, SideBarNavItem I think

What did you expect to happen? What happened instead? What would you like to see changed?

ariaLabel should be passed to the underlying button

What browser are you working in?

Any browser, but I’m using Chrome with the inspector up

What version of the Carbon Design System are you using?

How do I check this?

What offering/product do you work on? Any pressing ship or release dates we should be aware of?

Tekton Dashboard and Webhooks Extension, likely have a workaround

Steps to reproduce the issue

  • Screenshots or code

image

Sandbox code (can’t figure out how to share, share button just links me to a new editor, forking never returns):

import { render } from "react-dom";
import { Dropdown } from "carbon-components-react";
import React from "react";

import {
  SideNav as CarbonSideNav,
  SideNavItems,
  SideNavMenu,
  SideNavMenuItem
} from "carbon-components-react";

const NamespacesDropdown = props => {
  return <Dropdown {...props} />;
};

const allNamespacesLabel = "All Namespaces";

NamespacesDropdown.defaultProps = {
  allNamespacesLabel,
  items: [],
  loading: false,
  label: "Select Namespace",
  ariaLabel: "Select Namespace",
  titleText: "Namespace",
  emptyText: "No Namespaces found",
  showAllNamespaces: false
};

const App = () => (
  <div>
    <CarbonSideNav
      isFixedNav
      expanded
      isChildOfHeader={false}
      aria-label="Side navigation"
    >
      <SideNavItems>
        <SideNavMenu defaultExpanded title="Tekton">
          <SideNavMenuItem element={NamespacesDropdown} />
        </SideNavMenu>
      </SideNavItems>
    </CarbonSideNav>
  </div>
);

render(<App />, document.getElementById("root"));

I expect “Select Namespace” to be used as the aria label on the button instead of Open Menu

Also you can see this is case for the Dropdown component itself just using

http://react.carbondesignsystem.com/?path=/story/dropdown--default

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
abbeyhrtcommented, Oct 7, 2019

@a-roberts okay great! I’m going to close this for now but feel free to open it back up if the problem returns!

0reactions
a-robertscommented, Oct 7, 2019

@abbeyhrt everything’s now fine for our dropdown actually, I looked in the node_modules folder and observed carbon components 10.6.1 and 7.6.1 of carbon-components-react.

Had a look through our source code (https://github.com/tektoncd/dashboard, it was the namespaces dropdown that was impacted) and don’t see any relevant changes, unless @AlanGreene knows of anything else that could have caused this.

Thanks if a fix was provided 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Aria-label gives a DAP violation for <option> tag in dropdown
I am getting one for dropdowns that I'm not able to resolve. It is Accessible name does not match or contain the visible...
Read more >
Dropdown – Carbon Design System
Dropdowns present a list of options that can be used to filter or sort existing content. They can also be used as menus....
Read more >
Search Results - CVE
CVE-2022-4520, A vulnerability was found in WSO2 carbon-registry up to 4.8.11. ... This grants direct access to the infrastructure underlying the ...
Read more >
Diffstat - sites/www.git - www.gentoo.org
‑rw‑r‑‑r‑‑.gitignore 6 ‑rw‑r‑‑r‑‑.gitmodules 3 ‑rw‑r‑‑r‑‑ README 1 ‑rw‑r‑‑r‑‑ TODO 3
Read more >
https://trac.webkit.org/export/63854/trunk/WebCore...
The algorithm, as written, is a minor layer violation. ... Instead use the media-control button display type to select the image to paint....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found