zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
891 stars 232 forks source link

onAfterChange called with old values #201

Closed miromeir closed 3 years ago

miromeir commented 3 years ago

on a controlled 2-values slider, onAfterChange is getting called with old values(from before the change).

Desired Behaviour: onAfterChange should be passed new values, representing the slider after the change is finished (I think?)

CodeSandbox

Try changing slider values. then, change react-slider to v1.0.11 and try again. different results. Edit zillow/react-slider

stonebk commented 3 years ago

For now you can use onChange instead of onAfterChange and it should work.

Jordan-Eckowitz commented 3 years ago

on a controlled 2-values slider, onAfterChange is getting called with old values(from before the change).

Desired Behaviour: onAfterChange should be passed new values, representing the slider after the change is finished (I think?)

CodeSandbox

Try changing slider values. then, change react-slider to v1.0.11 and try again. different results. Edit zillow/react-slider

Having the same problem - onAfterChange returns the default values

stonebk commented 3 years ago

react-slider@1.1.2

Jordan-Eckowitz commented 3 years ago

react-slider@1.1.2

Works perfectly now, thanks!

kate-fsd commented 2 years ago

Hi! I sometimes have the same problem on iphone now, in controlled, 1-value component. Slider version 2.0.0 On android and desktop it works well