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

Added stopPropagation and preventDefault to onChange #11

Merged
merged 1 commit into from
Jan 18, 2016

Conversation

alex-e-leon
Copy link
Contributor

This fixes a bug when you wrap react-icheck in a label, as it currently
will trigger the onChange event twice (once when you click the checkbox,
once when the event bubbles up to the label).

This is inline with ichecks implementation see
https://github.com/fronteed/icheck/blob/1.x/icheck.js#L218

Note, that I'd prefer to not stop the event bubble chain, but due to ichecks implementation, I'm not sure there's any other way to fix this bug.

This fixes a bug when you wrap react-icheck in a label, as it currently
will trigger the onChange event twice (once when you click the checkbox,
once when the event bubbles up to the label).

This is inline with ichecks implementation see
https://github.com/fronteed/icheck/blob/1.x/icheck.js#L218
luqin pushed a commit that referenced this pull request Jan 18, 2016
Added stopPropagation and preventDefault to onChange
@luqin luqin merged commit 460dbdb into luqin:master Jan 18, 2016
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

Successfully merging this pull request may close these issues.

2 participants