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

Double slider layout bug on reset action

Open NeverovN opened this issue 2 years ago • 7 comments

On firing reset action which assigns new value to the slider boundaries, thumbs do move with animation to desired places. However, the progress bar of the slider remains at the past state until you change the state of anything on the screen. This is specific only for 2-thumbs slider.

Seems that there is some ref logic dependency, which does not reflect the correct state after replacing the original value.

https://user-images.githubusercontent.com/57796735/232573956-7158390f-0b3e-41e9-9019-3839cef9cbb3.mp4

NeverovN avatar Apr 17 '23 18:04 NeverovN

duplicate of https://github.com/miblanchard/react-native-slider/issues/338, there's solution right there but seems not good enough

Chronostyle avatar Apr 23 '23 07:04 Chronostyle

duplicate of https://github.com/miblanchard/react-native-slider/issues/338, there's solution right there but seems not good enough

This was a solution I thought of. However, it works inconsistently, as it is based on time. If you re-render screen to fast at the moment when slider thum os still finishes animation, this will lead to indicator stop at the point where the thumb is, not a the point is should be.

NeverovN avatar Apr 23 '23 08:04 NeverovN

can you share the code please

matthewadel avatar May 05 '23 20:05 matthewadel

Extra render isn't much of a solution. It's still visibly janky.

stevenharderjr avatar Jun 14 '23 18:06 stevenharderjr

Checkout by merge request which fixes this issue. I also included a patch file for those that want to try the fix out.

sfreeman28 avatar Jul 23 '23 23:07 sfreeman28

Hey @miblanchard, any chance the pull request above could be merged into main soon? It addresses a key issue that I've been facing, and I think it would be beneficial for others as well.

Adamchello avatar Sep 06 '23 11:09 Adamchello

Hey, have been facing the same issue for a while. Any ETA when this PR will be merged to NPM https://github.com/miblanchard/react-native-slider/pull/414/files ? It is really something I'm looking after. Thanks for your effort and contribution guys.

BiosBoy avatar Sep 28 '23 08:09 BiosBoy