Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(slider): allow tabindex overwrite
Browse files Browse the repository at this point in the history
* add test for tabindex overwriting

Fixes #5829. Closes #5830.
  • Loading branch information
devversion authored and ThomasBurleson committed Feb 4, 2016
1 parent 0873ace commit 47cfe44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/slider/slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ function SliderDirective($$rAF, $window, $mdAria, $mdUtil, $mdConstant, $mdThemi
// **********************************************************

function compile (tElement, tAttrs) {
tElement.attr({
tabIndex: 0,
role: 'slider'
});
if (!tAttrs.tabindex) tElement.attr('tabindex', 0);
tElement.attr('role', 'slider');

$mdAria.expect(tElement, 'aria-label');

Expand Down
10 changes: 10 additions & 0 deletions src/components/slider/slider.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,14 @@ describe('md-slider', function() {

});

it('should set a default tabindex', function() {
var slider = setup();
expect(slider.attr('tabindex')).toBe('0');
});

it('should not overwrite tabindex attribute', function() {
var slider = setup('tabindex="2"');
expect(slider.attr('tabindex')).toBe('2');
});

});

0 comments on commit 47cfe44

Please sign in to comment.