Skip to content

Commit

Permalink
Solves mui#70
Browse files Browse the repository at this point in the history
  • Loading branch information
Davi Ferreira committed Nov 18, 2014
1 parent 89e690d commit 95acd31
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/js/radio-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var RadioButton = React.createClass({
}
},

toggle: function() {
this.setState({ checked: !this.state.checked });
this.refs.radioButton.getDOMNode().checked = !this.refs.radioButton.getDOMNode().checked;
toggle: function(checked) {
this.setState({ checked: checked || !this.state.checked });
this.refs.radioButton.getDOMNode().checked = checked || !this.refs.radioButton.getDOMNode().checked;
},

render: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/js/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var Toggle = React.createClass({
var toggledState = !this.state.toggled;

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

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

0 comments on commit 95acd31

Please sign in to comment.