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

Documentation of onChange handling #34

Open
cdxOo opened this issue Nov 3, 2016 · 2 comments
Open

Documentation of onChange handling #34

cdxOo opened this issue Nov 3, 2016 · 2 comments

Comments

@cdxOo
Copy link

cdxOo commented Nov 3, 2016

When passing onChange to the checkox component I expected to be able to read e.target.checked which doesnt work, since it triggers before rerendering the inner checkbox. I found that you explicitely pass the 'checked' argument to the given onChange function. This is good, but i needed to search through your code to find out about this, and i think that this is non-default behaviour.
I would suggest adding this to the documentation.

@luqin
Copy link
Owner

luqin commented Nov 4, 2016

@cdxOo 👍

@ghost
Copy link

ghost commented Apr 17, 2017

For anyone wondering how to do this:

handleCheck(e, checked) {
    console.log(e.target.value); //outputs the value of the checkbox
    console.log(checked); //outputs true or false
  }
<Checkbox onChange = {this.handleCheck} value="Apple" label="Apple"/>

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

2 participants