Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Slider onChange is not called with value but with Event #268

Closed
greggigon opened this issue Mar 23, 2016 · 2 comments
Closed

Slider onChange is not called with value but with Event #268

greggigon opened this issue Mar 23, 2016 · 2 comments

Comments

@greggigon
Copy link
Contributor

Hi
First of all, excellent work.
I think I'm hitting a brick wall with Slider component.
According to docs:

onChange Function Callback taking 1 parameter with the new value Required

However, if I modify the Codepen example to :

<Slider min={0} max={100} defaultValue={0} onChange={(e) => console.log(e)}/>

when I move slider, I can see Event, not the Value being passed.
Any ideas?

@tleunen
Copy link
Owner

tleunen commented Mar 24, 2016

Thanks for reporting the issue. It's an error in the documentation. You'll receive the event and you can get the value with e.target.value.

greggigon added a commit to greggigon/react-mdl that referenced this issue Mar 24, 2016
tleunen added a commit that referenced this issue Mar 24, 2016
Documentation change for slider #268
@tleunen
Copy link
Owner

tleunen commented Mar 24, 2016

I'll release the fix in the doc later today when I find some time ;)

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

No branches or pull requests

2 participants