-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
How to get value of slider in onChange handler? #2978
Comments
@oliviertassinari, you're not saying this is only a documentation issue are you? Is there some way I can use Slider as-is to get the value? |
Can't you use the second parameter? I think that the callback looks like this: |
yes got it now. thanks! |
FYI neither the event nor the value includes the field name so I have to pass that the name as yet another param :-( |
Indeed, why is this bad? |
@jmjpro - you could also use a ref. |
with normal events the name is a field in the event.target object. not the case here since the event.target is a div instead of the backing hidden input element. |
Closing in favor of #3096. |
The SyntheticMouseEvent sent to the onChange handler has a target of div. That div doesn't contain the hidden element used to hide the slider value. As such, there doesn't seem to be a normal way to access the slider value in the event handler, which I need to do to update my state. Do I have to resort to refs?
The text was updated successfully, but these errors were encountered: