react-native-multi-slider
react-native-multi-slider copied to clipboard
How to turn this slider into a single value slider?
- [x] I have searched existing issues
- [x] I am using the latest multi slider version
Steps to Reproduce
Expected Behavior
Actual Behavior
Pass only one value to the values array e.g. two values slider: values = {[3,5]} one value slider: values = {[5]}
cf. examples folder
Is it just only me or there is a bug in this?
when I try to do this:
<MultiSlider
values={[1,10]}
sliderLength={slidersWidth}
onValuesChange={(value) => { setData((ps => ({ ...ps, value: [...value] }))) }}
min={1}
max={10}
step={1}
value={data?.value || info.default}
allowOverlap={false}
snapped
markerStyle={{ height: 30, width: 30, borderRadius: 20 }}
trackStyle={{ height: 4, borderRadius: 5 }}
selectedStyle={{ backgroundColor: '#242424' }}
unselectedStyle={{ backgroundColor: 'silver' }}
touchDimensions={{ height: 40, width: 40, borderRadius: 20, slipDisplacement: 40 }}
/>
Am never able to select the 10. I guess because somewhat the other marker is still there…
Am never able to select the 10. I guess because somewhat the other marker is still there…
I had the same problem! but I solved it with: allowOverlap={true}