Skip to content

Commit c33e7f8

Browse files
[test][chip] Add axe tests and WCAG conformance report (#49556)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 2d11bf7 commit c33e7f8

20 files changed

Lines changed: 2122 additions & 67 deletions

File tree

‎docs/data/material/components/chips/chips.a11y.json‎

Lines changed: 698 additions & 0 deletions
Large diffs are not rendered by default.

‎docs/data/material/components/chips/chips.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,6 @@ gain depth while clicked or touched.
100100

101101
## Accessibility
102102

103-
If the Chip is deletable or clickable then it is a button in tab order. When the Chip is focused (for example when tabbing) releasing (`keyup` event) `Backspace` or `Delete` will call the `onDelete` handler while releasing `Escape` will blur the Chip.
103+
If the Chip is deletable or clickable then it is a button in tab order. When the Chip is focused (for example when tabbing) releasing (`keyup` event) `Backspace` or `Delete` calls the `onDelete` handler.
104+
After a deletion, move focus to the next chip or to a nearby control, because the deleted chip leaves the page.
105+
To remove a disabled deletable Chip from the tab order, set `skipFocusWhenDisabled`.

‎docs/data/material/getting-started/accessibility/accessibility.md‎

Lines changed: 41 additions & 36 deletions
Large diffs are not rendered by default.

‎docs/data/material/getting-started/accessibility/knownGaps.json‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"Button",
88
"ButtonGroup",
99
"Checkbox",
10+
"Chip",
1011
{ "component": "Fab", "note": "the ring needs `disableFocusRipple`" },
1112
{ "component": "IconButton", "note": "the ring needs `disableFocusRipple` too" },
1213
"Radio",
@@ -21,6 +22,10 @@
2122
"affected": [
2223
"Avatar",
2324
{ "component": "Button", "note": "`info`, `warning`; `error` in dark mode" },
25+
{
26+
"component": "Chip",
27+
"note": "`info`, `warning`, focused or hovered `outlined`"
28+
},
2429
{ "component": "CircularProgress", "note": "`warning` with `enableTrackSlot`" },
2530
{
2631
"component": "Fab",
@@ -51,6 +56,30 @@
5156
"affected": [{ "component": "ToggleButton", "note": "`primary`, `error`, `info`, `success`" }],
5257
"workaround": "Add a non-color cue to the selected state, such as an icon"
5358
},
59+
{
60+
"gap": "A Chip label does not wrap, so a long label ends with an ellipsis and hides text",
61+
"criteria": ["1.4.10", "1.4.12"],
62+
"affected": ["Chip"],
63+
"workaround": "Let the label wrap with `height: 'auto'` and `whiteSpace: 'normal'`, as in the multiline demo"
64+
},
65+
{
66+
"gap": "A deletable Chip does not expose its delete action, and a disabled delete-only Chip stays focusable and does not expose its disabled state",
67+
"criteria": ["1.1.1", "4.1.2"],
68+
"affected": [{ "component": "Chip", "note": "`onDelete`; delete-only ignores Enter, Space" }],
69+
"workaround": "Describe the delete key with `aria-describedby`, and set `skipFocusWhenDisabled` on disabled chips"
70+
},
71+
{
72+
"gap": "Deleting a Chip with the keyboard moves focus to the page body",
73+
"criteria": ["2.4.3"],
74+
"affected": [{ "component": "Chip", "note": "`onDelete`" }],
75+
"workaround": "Move focus to the next chip, or to the input, in the `onDelete` handler"
76+
},
77+
{
78+
"gap": "The Chip delete icon is smaller than 24 by 24 CSS px, and its contrast is below 3:1",
79+
"criteria": ["1.4.11", "2.5.8"],
80+
"affected": [{ "component": "Chip", "note": "16 px `small`, 22 px `medium`" }],
81+
"workaround": "Enlarge the icon, and give it a darker color, with `sx` on `.MuiChip-deleteIcon`"
82+
},
5483
{
5584
"gap": "The extended Fab has a fixed height, so a label that wraps can spill out of it",
5685
"criteria": ["1.4.10", "1.4.12"],

0 commit comments

Comments
 (0)