Sharcoux / slider

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

onSlidingComplete ignored when onValueChange set #89

Closed cyril36 closed 9 months ago

cyril36 commented 11 months ago

Describe the bug If i set both onValueChange and onSlidingComplete, onSlidingComplete does not seems to be executed when i release the button while i think it should be the latest event that would occur on top of onValueChange here is an example :

<Slider
   ...
   onValueChange={(value)=>setAreaSize(value)}
   onSlidingComplete={(value) => {
              setAreaSize(0)
            }}
/>

To Reproduce Here is the code to reproduce it https://snack.expo.dev/@cyril.moreau/sharcoux-slider-demo Expected behavior When the press is released the number should be 0

Please complete the following information:

Sharcoux commented 10 months ago

It seems that I missed that issue, my bad. I'll be working on it right now.

Sharcoux commented 10 months ago

Ok, the problem is not that onSlidingComplete is not being executed. It's just that an extra onValueChange is being executed. I'm gonna fix that.

Sharcoux commented 10 months ago

@cyril36 fixed in version 7.0.7 along with a problem that caused multiple onChange events to be fired for the same value. Don't hesitate to provide feedback

cyril36 commented 9 months ago

I have tested it and it looks great! thank you for your fix