Uh oh!
There was an error while loading. Please reload this page.
ProgressBar: Adjust ProgressBar.Item for accessibility - #4878
Conversation
🦋 Changeset detectedLatest commit: 8b67e67 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
| const ariaAttributes = { | ||
| 'aria-valuenow': progressAsNumber && progressAsNumber >= 0 ? Math.round(progressAsNumber) : undefined, | ||
| 'aria-valuemin': 0, | ||
| 'aria-valuemax': 100, | ||
| } | ||
| warning( | ||
| children && | ||
| !ariaAttributes['aria-valuenow'] && | ||
| typeof (rest as React.AriaAttributes)['aria-valuenow'] === 'undefined' && | ||
| typeof (rest as React.AriaAttributes)['aria-valuetext'] === 'undefined', | ||
| 'Expected `aria-valuenow` or `aria-valuetext` to be provided to <ProgressBar>. Provide one of these values so screen reader users can determine the current progress. This warning will become an error in the next major release.', | ||
| ) |
There was a problem hiding this comment.
I'm curious if there's a reason why we didn't include ariaAttributes['aria-valuenow'] as a value to include in the warning conditional? Since we automatically create the aria-valuenow based on progressAsNumber being true and a number, is that sufficient enough if consumers don't provide an aria-valuenow themselves? Also, I added progressAsNumber >= 0 so we can include aria-valuenow values that start at 0.
Cc: @kendallgassner - would love your insight, but I realize that it's been a minute since we've introduced these changes 😅
There was a problem hiding this comment.
huh, your right that is odd and if a user passed it in it would override the value, we are setting via ...rest. 🤔 I think it's safe to remove the warning all together.
🟢 golden-jobs completed with status |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: Josh Black <joshblack@github.com>
joshblack
left a comment
There was a problem hiding this comment.
Looks great! Just left a small suggestion in case it was helpful 👍
Co-authored-by: Josh Black <joshblack@github.com>
TylerJDev
commented
Oct 30, 2024
Gonna wait on https://github.com/github/github/pull/344354 before I merge this PR in so we don't get failing tests 😁 |
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/349794 |
Closeshttps://github.com/github/primer/issues/3359
Changelog
New
Changed
aria-*attributes toProgressBar.ItemProgressBar.Itemasrole="progressbar"Removed
Rollout strategy
Testing & Reviewing
Merge checklist