Skip to content

Commit fae162e

Browse files
author
Benedikt Viebahn
committed
fix: loss of precision during arithmetic conversion
1 parent 4c05737 commit fae162e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StarRating.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ const StarRating = ({
277277
)}
278278
accessibilityValue={{
279279
min: 0,
280-
max: maxStars,
281-
now: rating,
280+
max: enableHalfStar ? maxStars * 2 : maxStars,
281+
now: enableHalfStar ? rating * 2 : rating, // this has to be an integer
282282
}}
283283
accessibilityActions={[
284284
{ name: 'increment', label: accessabilityIncrementLabel },

0 commit comments

Comments
 (0)