react-native-slider
react-native-slider copied to clipboard
How to control behavior of the thumb on click event
I need to set a slider value after click on the track. It works SOMETIMES as you can see from the video (thumb should be in consistence with gradient):
https://github.com/miblanchard/react-native-slider/assets/112638152/2fc4da31-a709-43e7-8d03-9746f1f99d9f
Config:
<Slider
animateTransitions
maximumTrackTintColor="transparent"
minimumValue={0}
maximumValue={100}
onSlidingComplete={onSlidingComplete}
onValueChange={onValueChange}
trackRightPadding={4}
trackStyle={sliderStyles.track}
thumbStyle={sliderStyles.thumb}
minimumTrackTintColor="transparent"
value={units}
/>
Desired behavior:
Control the value, after releasing the thumb I need to snap to the correct value on the track.
Current Solution
I am controlling the value using value argument. I know that it should not be a controlled value from documentation. However I need to fix this bug.
Note: it works great with swiping, clicking is the issue