Skip to content

Commit 0a1904d

Browse files
crisbetotinayuangao
authored andcommitted
fix(progress-bar): prevent users from tabbing into underlying SVG on 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.
1 parent 367160f commit 0a1904d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/lib/progress-bar/progress-bar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
The background div is named as such because it appears below the other divs and is not sized based
33
on values.
44
-->
5-
<svg width="100%" height="5" class="mat-progress-bar-background mat-progress-bar-element">
5+
<svg width="100%" height="5" focusable="false" class="mat-progress-bar-background mat-progress-bar-element">
66
<defs>
77
<pattern [id]="progressbarId" x="5" y="0" width="10" height="5" patternUnits="userSpaceOnUse">
88
<circle cx="2.5" cy="2.5" r="2.5"/>

src/lib/progress-bar/progress-bar.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ describe('MatProgressBar', () => {
8787
expect(progressComponent._primaryTransform()).toEqual({transform: 'scaleX(0.6)'});
8888
expect(progressComponent._bufferTransform()).toEqual({transform: 'scaleX(0.6)'});
8989
});
90+
91+
it('should not be able to tab into the underlying SVG element', () => {
92+
const svg = fixture.debugElement.query(By.css('svg')).nativeElement;
93+
expect(svg.getAttribute('focusable')).toBe('false');
94+
});
9095
});
9196

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

0 commit comments

Comments
 (0)