diff --git a/lib/commons/standards/implicit-html-roles.js b/lib/commons/standards/implicit-html-roles.js index aaa44b9226..ba6010dd54 100644 --- a/lib/commons/standards/implicit-html-roles.js +++ b/lib/commons/standards/implicit-html-roles.js @@ -109,7 +109,7 @@ const implicitHtmlRoles = { listElement && listElement.nodeName.toLowerCase() === 'datalist'; } - switch ((vNode.attr('type') || '').toLowerCase()) { + switch (vNode.props.type) { case 'button': case 'image': case 'reset': diff --git a/test/commons/aria/implicit-role.js b/test/commons/aria/implicit-role.js index 2fb087931e..8664eb8a66 100644 --- a/test/commons/aria/implicit-role.js +++ b/test/commons/aria/implicit-role.js @@ -301,6 +301,13 @@ describe('aria.implicitRole', function() { assert.equal(implicitRole(node), 'combobox'); }); + it('should return textbox for "input[type=invalid]"', function() { + fixture.innerHTML = ''; + var node = fixture.querySelector('#target'); + flatTreeSetup(fixture); + assert.equal(implicitRole(node), 'textbox'); + }); + it('should return region for "section" with accessible name aria-label', function() { fixture.innerHTML = '
'; var node = fixture.querySelector('#target');