Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 6a0ea9e

Browse files
committed
fix(ngAria): remove tabindex from radio buttons
Closes #12492
1 parent 9f716dd commit 6a0ea9e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Diff for: src/ngAria/aria.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ ngAriaModule.directive('ngShow', ['$aria', function($aria) {
235235
}
236236
},
237237
post: function(scope, elem, attr, ngModel) {
238-
var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem);
238+
var needsTabIndex = shouldAttachAttr('tabindex', 'tabindex', elem)
239+
&& !isNodeOneOf(elem, nodeBlackList);
239240

240241
function ngAriaWatchModelValue() {
241242
return ngModel.$modelValue;

Diff for: test/ngAria/ariaSpec.js

+7
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,13 @@ describe('$aria', function() {
628628
expectAriaAttrOnEachElement(element, 'tabindex', undefined);
629629
});
630630

631+
it('should not attach to native controls via ngmodel', function() {
632+
scope.$apply('val = null');
633+
compileElement('<input type="radio" name="value" value="1" ng-model="val">');
634+
635+
expect(element.attr('tabindex')).toBeUndefined();
636+
});
637+
631638
it('should not attach to random ng-model elements', function() {
632639
compileElement('<div ng-model="val"></div>');
633640
expect(element.attr('tabindex')).toBeUndefined();

0 commit comments

Comments
 (0)