Sharcoux / slider

React-Native and React-Native-Web compatible slider
ISC License
161 stars 31 forks source link

[Web] the slider freezes after going back and forth #57

Closed nakshatrasinghh closed 1 year ago

nakshatrasinghh commented 1 year ago
Sharcoux commented 1 year ago

Please try to illustrate your issue with this snack

nakshatrasinghh commented 1 year ago

https://snack.expo.dev/@nakshatrasinghh/slider1

Here is my snack

Sharcoux commented 1 year ago

Can you describe what exactly is the problem?

What is the expected behavior, and what is the current behavior?

nakshatrasinghh commented 1 year ago

Do you notice how the slider stops after continuously touching it? But the value of the slider (onValueChnage callback) still works

https://user-images.githubusercontent.com/53419293/212381612-c4e4f723-292c-4fea-817f-e3ad0dbdc3d9.mov

A little context of what this is all about, I am making sort of like a PWA which renders the mobile web view in the centre of the page

nakshatrasinghh commented 1 year ago

EDITED This behaviour is also happens when the image is not being passed, no thumbImage and CustomThumb is defined

Sharcoux commented 1 year ago

When I check your snack, I don't see the issue you describe...

slider-bug.webm

nakshatrasinghh commented 1 year ago

Yes, this issue is not happening on expo, but it happens on react native web view. Snack works fully fine idk why

nakshatrasinghh commented 1 year ago

Also, if I run it on my device (expo) after scanning code, this issue still happens

Sharcoux commented 1 year ago

Snack uses react-native-web, so it's the same stack. My guess is that your code is trying to control the value of the slider while it is changing. So the slider receive both inputs and has to make a choice between the value that changes when the user moves, and the value that you provide as prop.

Anyway, I can't help more as long as you don't reproduce the bug on expo. The rest is probably related to your implementation that I have no access to.

Sharcoux commented 1 year ago

Also, if I run it on my device (expo) after scanning code, this issue still happens

So it's not on the web? On what OS is it then?

nakshatrasinghh commented 1 year ago

Understood, thanks for the help my brother, really means a lot. Cheers and happy coding!

nakshatrasinghh commented 1 year ago

Also, if I run it on my device (expo) after scanning code, this issue still happens

So it's not on the web? On what OS is it then?

iOS yes

nakshatrasinghh commented 1 year ago

Snack uses react-native-web, so it's the same stack. My guess is that your code is trying to control the value of the slider while it is changing. So the slider receive both inputs and has to make a choice between the value that changes when the user moves, and the value that you provide as prop.

Anyway, I can't help more as long as you don't reproduce the bug on expo. The rest is probably related to your implementation that I have no access to.

heyy brother, thanks for this, just solved the issue, i was asynchronously changing the value of the text and the slider prop value together, now I made a synchronous call and it works absolutely fine