Skip to content

Commit

Permalink
fix(material/progress-bar): fix screenreader not reading aria-label (#…
Browse files Browse the repository at this point in the history
…22201)

* fix(material/progress-spinner): fix screenreader not reading out aria-label

* fixup! fix(material/progress-spinner): fix screenreader not reading out aria-label

(cherry picked from commit a9cdb08)
  • Loading branch information
annieyw committed Apr 2, 2021
1 parent 03947c7 commit 14ec1a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/material-experimental/mdc-progress-bar/progress-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export type ProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'quer
'role': 'progressbar',
'aria-valuemin': '0',
'aria-valuemax': '100',
// set tab index to -1 so screen readers will read the aria-label
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
'tabindex': '-1',
'[attr.aria-valuenow]': '(mode === "indeterminate" || mode === "query") ? null : value',
'[attr.mode]': 'mode',
'class': 'mat-mdc-progress-bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const BASE_STROKE_WIDTH = 10;
host: {
'role': 'progressbar',
'class': 'mat-mdc-progress-spinner mdc-circular-progress',
// set tab index to -1 so screen readers will read the aria-label
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
'tabindex': '-1',
'[class._mat-animation-noopable]': `_noopAnimations`,
'[style.width.px]': 'diameter',
'[style.height.px]': 'diameter',
Expand Down
3 changes: 3 additions & 0 deletions src/material/progress-bar/progress-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ let progressbarId = 0;
'role': 'progressbar',
'aria-valuemin': '0',
'aria-valuemax': '100',
// set tab index to -1 so screen readers will read the aria-label
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
'tabindex': '-1',
'[attr.aria-valuenow]': '(mode === "indeterminate" || mode === "query") ? null : value',
'[attr.mode]': 'mode',
'class': 'mat-progress-bar',
Expand Down
3 changes: 3 additions & 0 deletions src/material/progress-spinner/progress-spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `
host: {
'role': 'progressbar',
'class': 'mat-progress-spinner',
// set tab index to -1 so screen readers will read the aria-label
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
'tabindex': '-1',
'[class._mat-animation-noopable]': `_noopAnimations`,
'[style.width.px]': 'diameter',
'[style.height.px]': 'diameter',
Expand Down

0 comments on commit 14ec1a3

Please sign in to comment.