Skip to content

[test][toggle button] Add axe tests and WCAG conformance reports - #48921

Open
michelengelen wants to merge 8 commits into
mui:masterfrom
michelengelen:a11y/stack/toggle-button
Open

[test][toggle button] Add axe tests and WCAG conformance reports#48921
michelengelen wants to merge 8 commits into
mui:masterfrom
michelengelen:a11y/stack/toggle-button

Conversation

@michelengelen

@michelengelen michelengelen commented Aug 4, 2026

Copy link
Copy Markdown
Member

Adds axe coverage and WCAG 2.2 Level A/AA conformance reports for ToggleButton and ToggleButtonGroup.

ToggleButton

Result Count
✅ Supports 20
⚠️ Partially Supports 4
❌ Does Not Support 0
➖ Not Applicable 31

ToggleButtonGroup

Result Count
✅ Supports 4
⚠️ Partially Supports 0
❌ Does Not Support 0
➖ Not Applicable 31
↗ Inherited from ToggleButton 20

Known gaps: selected state conveyed almost entirely by hue (1.4.1), selected labels below 4.5:1 (1.4.3), and the ripple being the only focus indicator with no box-shadow fallback (1.4.11, 2.4.7).

Reports: ToggleButton/accessibility.md · ToggleButtonGroup/accessibility.md

Important

How to review this PR

Layer 8 of 14 in a stacked series (#48915#48926). Its branch is built on a11y/stack/radio (#48920). GitHub cannot chain PR bases across a fork, so every PR in the series targets master instead.

Review only the last commit5ef975a. Everything above it belongs to the layers below, and disappears as those merge.

Original work by @mj12albert. Supersedes #48733, rebased onto current master.

Part of the WCAG conformance effort (#14187).

@code-infra-dashboard

code-infra-dashboard Bot commented Aug 4, 2026

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@michelengelen
michelengelen force-pushed the a11y/stack/toggle-button branch from 06a3273 to 73b255e Compare August 5, 2026 09:56
@michelengelen michelengelen added test accessibility a11y scope: toggle button Changes related to the toggle button. scope: toggle group Changes related to the toggle group. labels Aug 5, 2026
@michelengelen
michelengelen force-pushed the a11y/stack/toggle-button branch 5 times, most recently from c386dda to b0ff077 Compare August 6, 2026 10:43
@michelengelen
michelengelen marked this pull request as ready for review August 7, 2026 10:15
@michelengelen
michelengelen force-pushed the a11y/stack/toggle-button branch 2 times, most recently from 10300a2 to a931f45 Compare August 7, 2026 13:00
Lets a fixture assert every axe rule it exercises rather than only the
CSS-dependent visual ones, which is what the per-component WCAG reports
need.
Adds a table-driven Playwright suite covering 1.4.10 Reflow, 1.4.4 Resize
Text and 1.4.12 Text Spacing across the assessed components. axe has no rule
for any of them, so they were rated Manual on evidence from source review.
@michelengelen
michelengelen force-pushed the a11y/stack/toggle-button branch from a931f45 to 5ef975a Compare August 11, 2026 12:25
@michelengelen

Copy link
Copy Markdown
Member Author

PR review

No findings.

The StandaloneToggleButton demo gains a real accessible name (aria-label="mark as done"), which fixes a genuine button-name violation in public docs. The 2.4.7 unit test is correctly browser-gated with it.skipIf(isJsdom()), and it is the reason ToggleButton needs no flag drop when #48945 automates 2.4.7 for the other components — the report is already unflagged with its own citation. Screenshot opt-outs for the ToggleButtonA11y* fixtures follow the same ordered disable/enable pattern as buttons.

Verdict

Approve - consistent with the stack template, plus a real docs accessibility fix.


🤖 Review generated with Claude Code

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y PR: out-of-date The pull request has merge conflicts and can't be merged. scope: toggle button Changes related to the toggle button. scope: toggle group Changes related to the toggle group. test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants