diff --git a/src/ngAria/aria.js b/src/ngAria/aria.js index 400d951e2bc0..f2980a413a9a 100644 --- a/src/ngAria/aria.js +++ b/src/ngAria/aria.js @@ -221,8 +221,8 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) { function shouldAttachRole(role, elem) { // if element does not have role attribute // AND element type is equal to role (if custom element has a type equaling shape) <-- remove? - // AND element is not INPUT - return !elem.attr('role') && (elem.attr('type') === role) && (elem[0].nodeName !== 'INPUT'); + // AND element is not in nodeBlackList + return !elem.attr('role') && (elem.attr('type') === role) && !isNodeOneOf(elem, nodeBlackList); } function getShape(attr, elem) { diff --git a/test/ngAria/ariaSpec.js b/test/ngAria/ariaSpec.js index 37c4f17bf1d8..ec1d29e560ce 100644 --- a/test/ngAria/ariaSpec.js +++ b/test/ngAria/ariaSpec.js @@ -272,6 +272,18 @@ describe('$aria', function() { compileElement(''); expect(element.attr('role')).toBe(undefined); }); + + they('should not add role to native $prop controls', { + select: '', + textarea: '', + button: '', + summary: '', + details: '
', + a: '' + }, function(tmpl) { + var element = $compile(tmpl)(scope); + expect(element.attr('role')).toBeUndefined(); + }); }); describe('aria-checked when disabled', function() {