Skip to content

[Switch] disabled prop doesn't set aria-disabled on input element #45436

Open
@DavidIvanov

Description

@DavidIvanov

Steps to reproduce

Add an MUI Switch to your document and give it the disabled prop.

Current behavior

Currently the aria-disabled is set on the span surrounding the input instead of on the input directly.
This causes accessibility issues with this rule
https://www.w3.org/WAI/WCAG22/Understanding/labels-or-instructions

Image

Expected behavior

The aria-disabled prop should be on the input directly.

Context

I want to be accessibility compliant with WCAG 2.1

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: Switch, aria-disabled, Accessibility

Metadata

Metadata

Assignees

Labels

accessibilitya11ybug 🐛Something doesn't workcomponent: switchThis is the name of the generic UI component, not the React module!package: material-uiSpecific to @mui/material

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions