Skip to content
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

onAfterChange called with old values #201

Closed
miromeir opened this issue Nov 9, 2020 · 5 comments
Closed

onAfterChange called with old values #201

miromeir opened this issue Nov 9, 2020 · 5 comments

Comments

@miromeir
Copy link

miromeir commented Nov 9, 2020

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
Copy link
Contributor

stonebk commented Nov 9, 2020

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

@Jordan-Eckowitz
Copy link

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
Copy link
Contributor

stonebk commented Nov 10, 2020

react-slider@1.1.2

@Jordan-Eckowitz
Copy link

react-slider@1.1.2

Works perfectly now, thanks!

@kate-fsd
Copy link

kate-fsd commented Apr 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants