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?
@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: onChange(event, value)
.
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 :-(
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.
Most helpful comment
Can't you use the second parameter? I think that the callback looks like this:
onChange(event, value)
.