diff --git a/lib/rules/aria-form-field-name-matches.js b/lib/rules/aria-form-field-name-matches.js index 78e5e08e90..09779d3aec 100644 --- a/lib/rules/aria-form-field-name-matches.js +++ b/lib/rules/aria-form-field-name-matches.js @@ -36,4 +36,15 @@ if (nodeName === 'BUTTON' || role === 'button') { return false; } +/** + * Ignore combobox elements if they have a child input + * (ARIA 1.1 pattern) + */ +if ( + role === 'combobox' && + axe.utils.querySelectorAll(virtualNode, 'input:not([type="hidden"])').length +) { + return false; +} + return true; diff --git a/test/rule-matches/aria-form-field-name-matches.js b/test/rule-matches/aria-form-field-name-matches.js index 0e87567de4..a69535b36f 100644 --- a/test/rule-matches/aria-form-field-name-matches.js +++ b/test/rule-matches/aria-form-field-name-matches.js @@ -65,4 +65,12 @@ describe('aria-form-field-name-matches', function() { assert.isFalse(actual); }); }); + + it('returns false when role=`combobox` has a child input', function() { + var vNode = queryFixture( + '
' + ); + var actual = rule.matches(vNode.actualNode, vNode); + assert.isFalse(actual); + }); });