diff --git a/src/ngAria/aria.js b/src/ngAria/aria.js index 32ae204633b9..036dd42b47de 100644 --- a/src/ngAria/aria.js +++ b/src/ngAria/aria.js @@ -235,7 +235,8 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) { } }, post: function(scope, elem, attr, ngModel) { - var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem); + var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem) + && !isNodeOneOf(elem, nodeBlackList); function ngAriaWatchModelValue() { return ngModel.$modelValue; diff --git a/test/ngAria/ariaSpec.js b/test/ngAria/ariaSpec.js index 911e6aab73d5..9389222458c0 100644 --- a/test/ngAria/ariaSpec.js +++ b/test/ngAria/ariaSpec.js @@ -616,16 +616,18 @@ describe('$aria', function() { describe('tabindex', function() { beforeEach(injectScopeAndCompiler); - it('should not attach to native controls', function() { - var element = [ - $compile("")(scope), - $compile("")(scope), - $compile("")(scope), - $compile("")(scope), - $compile("")(scope), - $compile("
")(scope) - ]; - expectAriaAttrOnEachElement(element, 'tabindex', undefined); + they('should not attach to native control $prop with ng-model', { + 'button': "", + 'a': "
", + 'input[text]': "", + 'input[radio]': "", + 'input[checkbox]': "", + 'textarea': "", + 'select': "", + 'details': "
" + }, function(html) { + compileElement(html); + expect(element.attr('tabindex')).toBeUndefined(); }); it('should not attach to random ng-model elements', function() {