diff --git a/lib/checks/aria/aria-required-children-evaluate.js b/lib/checks/aria/aria-required-children-evaluate.js index 1e7512d960..7094164316 100644 --- a/lib/checks/aria/aria-required-children-evaluate.js +++ b/lib/checks/aria/aria-required-children-evaluate.js @@ -34,6 +34,11 @@ export default function ariaRequiredChildrenEvaluate( return true; } + if (virtualNode.attr('aria-busy') === 'true') { + this.data({ messageKey: 'aria-busy' }); + return true; + } + const ownedRoles = getOwnedRoles(virtualNode, required); const unallowed = ownedRoles.filter( ({ role, vNode }) => vNode.props.nodeType === 1 && !required.includes(role) @@ -55,11 +60,6 @@ export default function ariaRequiredChildrenEvaluate( return true; } - if (virtualNode.attr('aria-busy') === 'true') { - this.data({ messageKey: 'aria-busy' }); - return true; - } - this.data(required); // Only review empty nodes when a node is both empty and does not have an aria-owns relationship diff --git a/test/checks/aria/required-children.js b/test/checks/aria/required-children.js index faf68eb714..b3eaf04db5 100644 --- a/test/checks/aria/required-children.js +++ b/test/checks/aria/required-children.js @@ -146,15 +146,13 @@ describe('aria-required-children', () => { }); }); - it('should fail list with an unallowed child, even if aria-busy="true"', () => { + it('should pass list with an unallowed child, if given aria-busy="true"', () => { const params = checkSetup(`