Skip to content

Commit

Permalink
fix(ProgressBar): add aria-valuetext attribute (#5100)
Browse files Browse the repository at this point in the history
* fix(ProgressBar): add aria-valuetext attribute

* Create slimy-sloths-whisper.md

* test(ProgressBar): update snapshot

* Update changeset to minor
  • Loading branch information
francinelucca authored Oct 16, 2024
1 parent 6d5f56d commit b0d858a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-sloths-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": minor
---

fix(ProgressBar): add aria-valuetext attribute
1 change: 1 addition & 0 deletions packages/react/src/ProgressBar/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export const ProgressBar = forwardRef<HTMLSpanElement, ProgressBarProps>(
'aria-valuenow': progressAsNumber ? Math.round(progressAsNumber) : undefined,
'aria-valuemin': 0,
'aria-valuemax': 100,
'aria-valuetext': progressAsNumber ? `${Math.round(progressAsNumber)}%` : undefined,
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ exports[`ProgressBar respects the "progress" prop 1`] = `
aria-valuemax={100}
aria-valuemin={0}
aria-valuenow={80}
aria-valuetext="80%"
className="c0"
role="progressbar"
>
Expand Down

0 comments on commit b0d858a

Please sign in to comment.