react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

Cannot slide, but only click.

Open Stophface opened this issue 2 years ago • 6 comments

I cannot smoothly slide the slider, but only click on the track to move the thumb. Is that expected behavious?

 <Slider
        thumbTouchSize={{ width: 50, height: 50 }}
        containerStyle={[styles.sliderContainer, elevation]}
        style={styles.slider}
        trackStyle={{marginLeft: 10}}
        minimumValue={30}
        maximumValue={100}
        minimumTrackTintColor={colors.highlight}
        maximumTrackTintColor={colors.otherElements}
        onValueChange={value => dispatch(setRadius(value))}
        step={10}
        value={radius} />

Stophface avatar Jun 17 '22 22:06 Stophface

How are you managing updating the current slider value?

miblanchard avatar Jul 07 '22 11:07 miblanchard

I'm having the same problem, I'm using it inside a tabview that has the behavior of dragging to the side

RobertoCostaTupinamba avatar Sep 03 '22 12:09 RobertoCostaTupinamba

I used something like this to ensure the slider value wouldn't constantly get updated from the state:

const [initialValue] = useState(value);

return <Slider value={initialValue} ... />

but this seemed to stop the thumb from moving, and instead I used the value prop directly from state. This did the trick and the thumb moves again.

timoisalive avatar Sep 14 '22 06:09 timoisalive

but this seemed to stop the thumb from moving, and instead I used the value prop directly from state. This did the trick and the thumb moves again.

Having read the doc another time, the behaviour I'm experiencing doesn't seem expected. Also, the react-community version of the Slider was working with my initialValue, so the behaviour is not one-to-one here. Not sure if this is a bug or feature, but just to let you know!

timoisalive avatar Sep 14 '22 06:09 timoisalive

It's unclear what the request is here. If you @Stophface or anyone else can provide I reproducible example I may be able to help. It is not expected that you can't slide the slider, and in all my use cases this is working as expected.

miblanchard avatar Dec 28 '22 16:12 miblanchard

@miblanchard Simlpy set up a new project, include the slider and you are unable to press and hold the large circle and slide it up and down. You have to repeatedly press on the line above or below the circle for the circle to move in small steps up or down.

Stophface avatar Jan 03 '23 11:01 Stophface