React-native-slider: Slider still jumping all over the place when sliding back and forth using step={1}

Created on 19 Nov 2019  路  11Comments  路  Source: callstack/react-native-slider

This used to be an issue #109 for users using old react native versions. Now that we updated, the issue still seems to persist.

Using the latest version:

"@react-native-community/slider": "2.0.3",
"react-native": "0.61.4",
bug report

All 11 comments

@schumannd What iOS version have you tested?

iOS 13.1.2

It is not as bad as it used to be for the older version of the slider. Just when using step={1} and sliding quickly back and forth

This issue should be fixed in version 2.0.6. Please check it out and re-open this if it still occurs :)

It was an issue caused by my handling of onValueChange to begin with. So it probably wasn't broken in the end. Thanks for your help!

It was an issue caused by my handling of onValueChange to begin with. So it probably wasn't broken in the end. Thanks for your help!

@schumannd How did you handle it? I have the same issue but with RN 0.55.4.

@joshbg2k actually we didn't.

The issue arises for us if we add any state update to the onValueChange vs. currentValue loop. Removing this, or only using onSlidingComplete avoids the problem. For us this was not an option though, as we want a "speech bubble" to always stay with the sliding head. Is this situation similar to yours?

@schumannd Yeah it's really similar. My slider enables a range of values in steps, so when the user slides in either direction, the label for each step changes based on it being enabled or disabled, so I use onValueChange to update the state and manage that. So I think we're both in the same boat - we want richer user feedback _while_ the user is using the slider. Looks like I'll have to use onSlidingComplete and update multiple labels at once at the end of the interaction. Not ideal but at least the feature will be usable until a fix or alternative is available.

@joshbg2k, @michalchudziak I would say it is not fixed then. It used to work before we updated to RN 61.4. So it might be related to a change in how RN updates state. I also couldn't find any reference to currentValue in the README. Is that not supported anymore? Maybe that's where the issue lies.

For me the slider also jumps around, but also when step > 1. It doesn't change if I don't set the state in onValueChange. For right now I needed to switch to another slider library.
Also I am using the latest version 2.0.8.

@michalchudziak Could we reopen this please?

I was unable to reproduce any jumping around with the current example, if anyone is still experiencing this perhaps they could extend the example to demonstrate it? Without a demo it's hard to reproduce.
Separately if people want the tap-to-click feature that caused the jumping around I think I have the implemented correctly in pending PR #201 with a patch attached to it so you may try it out

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EJohnF picture EJohnF  路  8Comments

ralph-dev picture ralph-dev  路  10Comments

javadi69 picture javadi69  路  4Comments

gdoudeng picture gdoudeng  路  5Comments

akrger picture akrger  路  6Comments