Skip to content

Commit

Permalink
fix: slider not updating value properly
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Dec 18, 2024
1 parent b46baba commit 384c342
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/components/SliderInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ const SliderInput: React.FC<SliderInputProps> = ({

const handleSliderChange = (v: number) => {
if (!isNaN(clamp(v, min, max, precision))) onValueChange(v)
setTextValue(value.toString())
setTextValue(v.toString())
}

const handleTextInputChange = (t: string) => {
let v = 0
setTextValue(t)
v = parseFloat(t)

if (!isNaN(v)) onValueChange(clamp(v, min, max, precision))
}

Expand Down

0 comments on commit 384c342

Please sign in to comment.