Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 848a301 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 |
UnderHear
left a comment
There was a problem hiding this comment.
Replacing parseInt with parseFloat preserves decimal precision before the existing Math.round, making numeric and string decimal inputs consistent. However, it also changes how some special strings are handled:
| Input | Previous aria-valuenow |
New aria-valuenow |
|---|---|---|
"33.8" |
33 |
34 |
"Infinity" |
0 |
Infinity |
"1e2" |
1 |
100 |
"1e-2" |
1 |
0 |
"1e309" |
1 |
Infinity |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The published behavior change is missing the required patch changeset.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes ProgressBar accessibility values so numeric and string decimal inputs round consistently without changing visual width.
Changes:
- Replaces
parseIntwithparseFloatfor string progress values. - Adds regression tests covering decimal rounding and preserved width.
| File | Description |
|---|---|
| packages/react/src/ProgressBar/ProgressBar.tsx | Preserves string decimals before rounding accessibility values. |
| packages/react/src/ProgressBar/ProgressBar.test.tsx | Checks both input types produce value 34 and width 33.8%. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
FYI: I've enabled auto-merge, it will merge when
Sorry, that one is only available for staff for now! |


Fix inconsistent
aria-valuenowrounding between numeric and string decimal progress values.Previously:
Both render a width of
33.8%, but expose different accessibility values becauseparseInttruncates the decimal part of string inputs beforeMath.roundcan round the value.Replacing
parseIntwithparseFloatpreserves the decimal part, allowing the existingMath.roundto round both numeric and string inputs to the nearest integer consistently. Now, both33.8and"33.8"producearia-valuenow="34", while the visual width remains33.8%.Changelog
New
Changed
parseFloatinstead ofparseIntwhen parsing string progress values, preserving decimals for the existing rounding logic.Removed
Rollout strategy
Testing & Reviewing
33.8and"33.8"both producearia-valuenow="34"while preserving the33.8%visual width.