diff --git a/lib/checks/aria/required-children.js b/lib/checks/aria/required-children.js index 19bf438f53..be6d50702b 100644 --- a/lib/checks/aria/required-children.js +++ b/lib/checks/aria/required-children.js @@ -46,6 +46,15 @@ function missingRequiredChildren(node, childRoles, all) { } } + // combobox > textbox exception: + // remove textbox from missing roles if node is a native input + if (node.tagName === 'INPUT' && node.type === 'text') { + var textboxIndex = missing.indexOf('textbox'); + if (textboxIndex >= 0) { + missing.splice(textboxIndex, 1); + } + } + if (missing.length) { return missing; } if (!all && childRoles.length) { return childRoles; } return null; diff --git a/test/checks/aria/required-children.js b/test/checks/aria/required-children.js index e63ff498b3..6938638c0f 100644 --- a/test/checks/aria/required-children.js +++ b/test/checks/aria/required-children.js @@ -97,6 +97,12 @@ describe('aria-required-children', function () { assert.isTrue(checks['aria-required-children'].evaluate.apply(checkContext, params)); }); + it('should pass a native input with role comboxbox when missing child is role textbox', function () { + fixture.innerHTML = '
Nothing here.
'; + var node = fixture.querySelector('#target'); + assert.isTrue(checks['aria-required-children'].evaluate.call(checkContext, node)); + }); + it('should pass one indirectly aria-owned child when one required', function () { var params = checkSetup('