Skip to content

Commit 4c70b53

Browse files
committed
fix Slider compute percent error when minValue is not 0
1 parent 1e670c2 commit 4c70b53

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/actify/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "actify",
3-
"version": "0.5.3",
3+
"version": "0.5.4",
44
"license": "MIT",
55
"author": "Lerte Smith",
66
"keywords": [

packages/actify/src/components/Sliders/Slider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ const Slider = (props: SliderProps) => {
2626
trackRef
2727
)
2828

29-
const percent = Number(state.getThumbValueLabel(0)) / (maxValue - minValue)
29+
const percent =
30+
(Number(state.getThumbValueLabel(0)) - minValue) / (maxValue - minValue)
3031

3132
return (
3233
<div

0 commit comments

Comments
 (0)