Skip to content

Commit 5858a47

Browse files
committed
update test and add note
1 parent 10dfcaf commit 5858a47

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ const alwaysValid = [
170170
{ code: '<style role="button" />;' },
171171
{ code: '<sub role="button" />;' },
172172
{ code: '<summary role="button" />;' },
173-
{ code: '<summary role="listitem" />;' },
174173
{ code: '<sup role="button" />;' },
175174
{ code: '<th role="button" />;' },
176175
{ code: '<time role="button" />;' },
@@ -373,6 +372,7 @@ const neverValid = [
373372
{ code: '<select className="foo" role="listitem" />', errors: [expectedError] },
374373
{ code: '<textarea className="foo" role="listitem" />', errors: [expectedError] },
375374
{ code: '<tr role="listitem" />;', errors: [expectedError] },
375+
{ code: '<summary role="listitem" />;', errors: [expectedError] },
376376
/* Custom elements */
377377
{ code: '<Link href="http://x.y.z" role="img" />', errors: [expectedError], settings: componentsSettings },
378378
];

src/util/isInteractiveElement.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ function checkIsInteractiveElement(tagName, attributes): boolean {
9696
}
9797
// Check in elementAXObjects for AX Tree associations for this element.
9898
const isInteractiveAXElement = some(iterFrom(interactiveElementAXObjectSchemas), elementSchemaMatcher);
99-
if (isInteractiveAXElement) {
99+
if (
100+
isInteractiveAXElement
101+
|| tagName === 'summary' // TODO: Remove this hard-coded addition once axobject-query is updated.
102+
) {
100103
return true;
101104
}
102105

0 commit comments

Comments
 (0)