Skip to content

Commit

Permalink
Merge pull request #77 from Jersonodev/radioButton_toggle_bug
Browse files Browse the repository at this point in the history
Radio button toggle bug. Fixes #70.
  • Loading branch information
Hai Nguyen committed Nov 18, 2014
2 parents 6509529 + 81d3a11 commit 5ab7e68
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ var Toggle = React.createClass({
},

_onClick: function(e) {
if (this.refs.radioButton._onClick != null) {
this.refs.radioButton._onClick = null;
this.refs.radioButton.setState({ checked: false});
this.refs.radioButton.refs.radioButton.getDOMNode().checked = false;
}
var toggledState = !this.state.toggled;

this.setState({ toggled: toggledState });
this.refs.radioButton.toggle();

if (this.props.onToggle) this.props.onToggle(e, toggledState);
}
Expand Down

0 comments on commit 5ab7e68

Please sign in to comment.