Skip to content

Commit 7106864

Browse files
khiga8ljharb
authored andcommitted
update test and add note
1 parent 965e7f0 commit 7106864

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

__tests__/src/rules/no-interactive-element-to-noninteractive-role-test.js

+1
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ const neverValid = [
372372
{ code: '<select className="foo" role="listitem" />', errors: [expectedError] },
373373
{ code: '<textarea className="foo" role="listitem" />', errors: [expectedError] },
374374
{ code: '<tr role="listitem" />;', errors: [expectedError] },
375+
{ code: '<summary role="listitem" />;', errors: [expectedError] },
375376
/* Custom elements */
376377
{ code: '<Link href="http://x.y.z" role="img" />', errors: [expectedError], settings: componentsSettings },
377378
];

src/util/isInteractiveElement.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ function checkIsInteractiveElement(tagName, attributes): boolean {
102102
}
103103
// Check in elementAXObjects for AX Tree associations for this element.
104104
const isInteractiveAXElement = some(iterFrom(interactiveElementAXObjectSchemas), elementSchemaMatcher);
105-
if (isInteractiveAXElement) {
105+
if (
106+
isInteractiveAXElement
107+
|| tagName === 'summary' // TODO: Remove this hard-coded addition once axobject-query is updated.
108+
) {
106109
return true;
107110
}
108111

0 commit comments

Comments
 (0)