Skip to content

Commit 7effd93

Browse files
adamrnearybeefancohen
authored andcommitted
[fix] - Add "switch" aria role (#99)
1 parent 489da17 commit 7effd93

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/util/attributes/role.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2446,6 +2446,31 @@
24462446
"requiredProps": [],
24472447
"abstract": true
24482448
},
2449+
"SWITCH": {
2450+
"requiredProps": [
2451+
"ARIA-CHECKED"
2452+
],
2453+
"props": [
2454+
"ARIA-CHECKED",
2455+
"ARIA-ATOMIC",
2456+
"ARIA-BUSY",
2457+
"ARIA-CONTROLS",
2458+
"ARIA-DESCRIBEDBY",
2459+
"ARIA-DISABLED",
2460+
"ARIA-DROPEFFECT",
2461+
"ARIA-FLOWTO",
2462+
"ARIA-GRABBED",
2463+
"ARIA-HASPOPUP",
2464+
"ARIA-HIDDEN",
2465+
"ARIA-INVALID",
2466+
"ARIA-LABEL",
2467+
"ARIA-LABELLEDBY",
2468+
"ARIA-LIVE",
2469+
"ARIA-OWNS",
2470+
"ARIA-RELEVANT"
2471+
],
2472+
"abstract": false
2473+
},
24492474
"TAB": {
24502475
"requiredProps": [],
24512476
"abstract": false,

tests/src/rules/aria-role.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ ruleTester.run('aria-role', rule, {
5454
{ code: '<div role={role || "button"} />', parserOptions },
5555
{ code: '<div role={role || "foobar"} />', parserOptions },
5656
{ code: '<div role="tabpanel row" />', parserOptions },
57+
{ code: '<div role="switch" />', parserOptions },
5758
{ code: '<div role="doc-abstract" />', parserOptions },
5859
{ code: '<div role="doc-appendix doc-bibliography" />', parserOptions },
5960
{ code: '<Bar baz />', parserOptions },

0 commit comments

Comments
 (0)