-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating step to achieve an uneven step ratio #477
Comments
Hello @Alicecold! |
That can be fixed: however, the code is kind of messy (having inline conditional rendering in so many places) and I am new in this project. I will try to split it up into the relevant parts. If you need an complete mimimal working example, it would take a lot more intrusive extraction, so is would have to do for now. Tell me if this isn't enough to replicate the problem! This is our implementation of the slider component (in a separate file/component):
Use in the component:
The callback function for onChange and declaration of stepInterval and trigger Interval:
Originally initialValue was erronously set to triggerInterval on all uses of Slider, which made the sliders jump around when quickly swiped (tested on android, with expo 47). Now when I do the same thing it instead resets to 500 instead of to the value I've tried to set it to in this particular use of the component. Otherwise it works flawlessly. |
Hello! I am currently working on an app where I'd like to set an specific distance. At distances longer than 1000m it doesn't really make sense to have it set on steps of 100m anymore, so then it would be better with steps of 500m, while on distances shorter than 1000m it would be nice to have the specificity of 100m steps.
Currently we are doing this by updating the step value based on the current value of the slider. However, this seems to sometime fail, and sudden changes to the value seem to reset the slider to it's starting value (500m).
I am posing this as a question since I have no idea of this is an bug or (more likely) that our implementation is borky. Is there a better way to implement an uneven stepping of the slider?
The text was updated successfully, but these errors were encountered: