Skip to content

Commit a9cdb08

Browse files
authored
fix(material/progress-bar): fix screenreader not reading aria-label (#22201)
* fix(material/progress-spinner): fix screenreader not reading out aria-label * fixup! fix(material/progress-spinner): fix screenreader not reading out aria-label
1 parent ed09a73 commit a9cdb08

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/material-experimental/mdc-progress-bar/progress-bar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'quer
5050
'role': 'progressbar',
5151
'aria-valuemin': '0',
5252
'aria-valuemax': '100',
53+
// set tab index to -1 so screen readers will read the aria-label
54+
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
55+
'tabindex': '-1',
5356
'[attr.aria-valuenow]': '(mode === "indeterminate" || mode === "query") ? null : value',
5457
'[attr.mode]': 'mode',
5558
'class': 'mat-mdc-progress-bar',

src/material-experimental/mdc-progress-spinner/progress-spinner.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ const BASE_STROKE_WIDTH = 10;
5858
host: {
5959
'role': 'progressbar',
6060
'class': 'mat-mdc-progress-spinner mdc-circular-progress',
61+
// set tab index to -1 so screen readers will read the aria-label
62+
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
63+
'tabindex': '-1',
6164
'[class._mat-animation-noopable]': `_noopAnimations`,
6265
'[style.width.px]': 'diameter',
6366
'[style.height.px]': 'diameter',

src/material/progress-bar/progress-bar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ let progressbarId = 0;
9292
'role': 'progressbar',
9393
'aria-valuemin': '0',
9494
'aria-valuemax': '100',
95+
// set tab index to -1 so screen readers will read the aria-label
96+
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
97+
'tabindex': '-1',
9598
'[attr.aria-valuenow]': '(mode === "indeterminate" || mode === "query") ? null : value',
9699
'[attr.mode]': 'mode',
97100
'class': 'mat-progress-bar',

src/material/progress-spinner/progress-spinner.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
109109
host: {
110110
'role': 'progressbar',
111111
'class': 'mat-progress-spinner',
112+
// set tab index to -1 so screen readers will read the aria-label
113+
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
114+
'tabindex': '-1',
112115
'[class._mat-animation-noopable]': `_noopAnimations`,
113116
'[style.width.px]': 'diameter',
114117
'[style.height.px]': 'diameter',

0 commit comments

Comments
 (0)