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

Checkmark select is failing Axe scan, interactive controls must not be nested #42159

Open
bryans-ashn opened this issue May 7, 2024 · 1 comment
Assignees
Labels
component: select This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@bryans-ashn
Copy link

bryans-ashn commented May 7, 2024

Steps to reproduce

https://mui.com/material-ui/react-select/#checkmarks

Required dependencies: Axe DevTools browser extension

Steps:

  1. Navigate to https://mui.com/material-ui/react-select/#checkmarks
  2. Open DevTools for your browser of choice (tested in Chrome 124.0.6367.119)
  3. Expand the select control within the Charkmarks example
  4. Scan ALL of my page with Axe DevTools

Attempted to resolve this issue a few different ways but none of them worked.

<Checkbox									
	disabled   // this works but the styling defaults to the disabled look
	checked={/* put your checked code here */}
	// tried different combinations of the following but none of these worked
	inputProps={{
		'tabIndex': -1,
		'aria-hidden': true,
		'aria-label': option.name,
		'title': option.name,
	}}
/>

Current behavior

Axe DevTools flags each of the nested checkboxes as an issue. "Interactive controls must not be nested".

AxeIssues_NestedControlsMUISelectCheckbox_NoGUI

Expected behavior

Either the MUI documentation should note the charkmarks select variant example is not compliant with accessibility rules or the Checkmarks select variant example code should be compliant.

Context

Our UX designers desire a checkbox nested drop down control because the checkboxes more clearly delineate a selected state over the selection highlighting.

Your environment

npx @mui/envinfo
  Chrome 124.0.6367.119
    System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.0.6 - C:\Program Files\nodejs\pnpm.CMD
  Browsers:
    Chrome: Not Found
    Edge: Chromium (124.0.2478.67)
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1
    @emotion/styled: ^11.11.0 => 11.11.0
    @mui/base: 5.0.0-beta.28 => 5.0.0-beta.28
    @mui/icons-material: ^5.14.19 => 5.14.19
    @mui/material: ^5.15.7 => 5.15.16
    @types/react: ^18.2.42 => 18.2.43
    react: ^18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    typescript: ^5.3.3 => 5.3.3

Search keywords: checkbox select nested accessibility

@bryans-ashn bryans-ashn added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 7, 2024
@zannager zannager added the component: select This is the name of the generic UI component, not the React module! label May 8, 2024
@bryans-ashn bryans-ashn changed the title Checkmark select is failing Axe scan, interactive controls must not be selected Checkmark select is failing Axe scan, interactive controls must not be nested May 8, 2024
@yassinmars
Copy link

I verified the accessibility issue with the "Checkmarks" select variant using Axe DevTools. It flags the nested interactive controls which isn't compliant with accessibility standards.

my proposed solution is to modify the Checkbox component's implementation and adopt non-interactive elements for the checkbox representation within the select dropdown instead of using interactive elements (like or ) within other interactive elements (), or adjust role attributes to bypass the nesting violation. This would preserve user experience while aligning with accessibility guidelines.

Updating the documentation with this corrected approach will help developers implement more accessible interfaces using MUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

4 participants