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.

Dropdown menu a11y checker failures

See original GitHub issue

Using Dropdown from carbon-components-react has errors in the IBM Equal Access Accessibility Checker tool

Browser Chrome

Automated testing tool and ruleset latest

Detailed description

What version of the Carbon Design System are you using? “carbon-components”: “10.15.0”, “carbon-components-react”: “7.15.0”,

What WCAG 2.1 checkpoint does the issue violate? The ‘id’ “downshift-0-label” specified for the WAI-ARIA property ‘aria-labelledby’ value is not valid Violation: The descendent <div> element with “option” role has no focusable child element Needs review: The input element does not have an associated visible label

Please create a reduced test case in CodeSandbox

Easily recreate with https://codesandbox.io/s/github/carbon-design-system/carbon/tree/master/packages/react/examples/codesandbox?file=/src/index.js

with this code: `import React from ‘react’; import { render } from ‘react-dom’; import { Button, Dropdown } from ‘carbon-components-react’;

var items = [{ id: ‘option-0’, text: ‘Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vitae, aliquam. Blanditiis quia nemo enim voluptatibus quos ducimus porro molestiae nesciunt error cumque quaerat, tempore vero unde eum aperiam eligendi repellendus.’ }, { id: ‘option-1’, text: ‘Option 1’ }, { id: ‘option-2’, text: ‘Option 2’ }, { id: ‘option-3’, text: ‘Option 3’ }, { id: ‘option-4’, text: ‘Option 4’ }, { id: ‘option-5’, text: ‘Option 5’ }];

var itemToString = function itemToString(item) { return item ? item.text : ‘’; }

const App = () => (

<div> <Dropdown label='Actions' itemToString={itemToString} items={items}/> </div> );

render(<App />, document.getElementById(‘root’)); `

Additional information

  • Screenshots or code image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tw15egancommented, Aug 31, 2020

Would we be able to add a hideLabel prop that adds the bx--visually-hidden class to the label, but would still keep it there for assisted technology users?

0reactions
dakahncommented, Oct 19, 2020

@k8vance88 That screen shot is actually a great example of what the WCAG guidance is trying to have developers maintained. In that second example, once the user makes a selection – the form element no longer has a visual label. It’s replaced by the selection. User’s with cognitive disabilities – or who are returning to a form after some time away could be stuck inferring the form element’s role from the options.

I’m going to close this issue as resolved. Since the first screen shot follows our design guidance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failures | Techniques for WCAG 2.0 - W3C
This describes the failure condition that results when CSS, rather than structural markup, is used to modify the visual layout of the content, ......
Read more >
Building Accessible Menu Systems - Smashing Magazine
The advantage of moving focus between menu items using the arrow keys is that Tab is preserved for moving out of the menu....
Read more >
Top 5 Accessibility Issues in 2022 - Intopia
In this article, we list the top 5 WCAG-related failures and how to test for them (note that most of these issues cannot...
Read more >
Checklist - The A11Y Project
The issues this checklist prompts you to check for covers a wide range of ... Make sure that form input errors are displayed...
Read more >
Improve accessibility with the Accessibility Checker
In the Accessibility pane, you'll see a list of errors, warnings, and tips with ... In the Check for Issues drop-down menu, select...
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