evidence-dev/evidence

[Bug]: Slider should support numbers as strings

Closed this issue · 1 comments

Describe the bug

defaultValue and step props currently do not convert string inputs into numbers, causing the component to break in some scenarios. Same logic for min and max should be applied to those props

Steps to Reproduce

Add slider with defaultValue and step specified

Logs

No response

System Info

No response

Severity

annoyance

Additional Information, or Workarounds

Wrap numbers with {}. E.g.,:

<Slider
   defaultValue={0.11}
   step={0.02}
/>

@kwongz Can you take this one? Lets refactor Slider to use toNumber for any props that are numbers