File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ import isAbstractRole from '../util/isAbstractRole';
21
21
import isHiddenFromScreenReader from '../util/isHiddenFromScreenReader' ;
22
22
import isInteractiveElement from '../util/isInteractiveElement' ;
23
23
import isInteractiveRole from '../util/isInteractiveRole' ;
24
+ import isNonInteractiveElement from '../util/isNonInteractiveElement' ;
25
+ import isNonInteractiveRole from '../util/isNonInteractiveRole' ;
24
26
import isPresentationRole from '../util/isPresentationRole' ;
25
27
26
28
const errorMessage =
@@ -65,6 +67,10 @@ module.exports = {
65
67
} else if (
66
68
isInteractiveElement ( type , attributes )
67
69
|| isInteractiveRole ( type , attributes )
70
+ || (
71
+ ! isNonInteractiveElement ( type , attributes )
72
+ && ! isNonInteractiveRole ( type , attributes )
73
+ )
68
74
|| isAbstractRole ( type , attributes )
69
75
) {
70
76
// This rule has no opinion about abtract roles.
Original file line number Diff line number Diff line change @@ -37,11 +37,11 @@ const pureInteractiveRoleElements = [...elementRoles.entries()]
37
37
) : ElementCallbackMap => {
38
38
const interactiveElements = accumulator ;
39
39
const elementName = elementSchema . name ;
40
- const elementAttributes = elementSchema . attributes || new Map ( [ ] ) ;
40
+ const elementAttributes = elementSchema . attributes || [ ] ;
41
41
interactiveElements [ elementName ] = ( attributes : Array < Node > ) : boolean => {
42
42
const passedAttrCheck =
43
- elementAttributes . size === 0 ||
44
- [ ... elementAttributes . values ( ) ] . every (
43
+ elementAttributes . length === 0 ||
44
+ elementAttributes . every (
45
45
( controlAttr ) : boolean => attributes . some (
46
46
( attr ) : boolean => (
47
47
controlAttr . name === propName ( attr ) . toLowerCase ( )
You can’t perform that action at this time.
0 commit comments