Skip to content

Commit

Permalink
fix(ngAria): remove tabindex from radio buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
marcysutton committed Oct 14, 2015
1 parent 9f716dd commit 6a0ea9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ngAria/aria.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions test/ngAria/ariaSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,13 @@ describe('$aria', function() {
expectAriaAttrOnEachElement(element, 'tabindex', undefined);
});

it('should not attach to native controls via ngmodel', function() {
scope.$apply('val = null');
compileElement('<input type="radio" name="value" value="1" ng-model="val">');

expect(element.attr('tabindex')).toBeUndefined();
});

it('should not attach to random ng-model elements', function() {
compileElement('<div ng-model="val"></div>');
expect(element.attr('tabindex')).toBeUndefined();
Expand Down

0 comments on commit 6a0ea9e

Please sign in to comment.