Skip to content

Commit

Permalink
fix(progress-bar): prevent users from tabbing into underlying SVG on …
Browse files Browse the repository at this point in the history
…IE (#9638)

Fixes users being able to tab into the SVG element inside the progress bar on IE where all SVGs are focusable by default.
  • Loading branch information
crisbeto authored and tinayuangao committed Jan 31, 2018
1 parent 367160f commit 0a1904d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/progress-bar/progress-bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
The background div is named as such because it appears below the other divs and is not sized based
on values.
-->
<svg width="100%" height="5" class="mat-progress-bar-background mat-progress-bar-element">
<svg width="100%" height="5" focusable="false" class="mat-progress-bar-background mat-progress-bar-element">
<defs>
<pattern [id]="progressbarId" x="5" y="0" width="10" height="5" patternUnits="userSpaceOnUse">
<circle cx="2.5" cy="2.5" r="2.5"/>
Expand Down
5 changes: 5 additions & 0 deletions src/lib/progress-bar/progress-bar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ describe('MatProgressBar', () => {
expect(progressComponent._primaryTransform()).toEqual({transform: 'scaleX(0.6)'});
expect(progressComponent._bufferTransform()).toEqual({transform: 'scaleX(0.6)'});
});

it('should not be able to tab into the underlying SVG element', () => {
const svg = fixture.debugElement.query(By.css('svg')).nativeElement;
expect(svg.getAttribute('focusable')).toBe('false');
});
});

describe('buffer progress-bar', () => {
Expand Down

0 comments on commit 0a1904d

Please sign in to comment.