Skip to content

Commit 5ab7e68

Browse files
committed
Merge pull request #77 from Jersonodev/radioButton_toggle_bug
Radio button toggle bug. Fixes #70.
2 parents 6509529 + 81d3a11 commit 5ab7e68

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/js/toggle.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,14 @@ var Toggle = React.createClass({
3636
},
3737

3838
_onClick: function(e) {
39+
if (this.refs.radioButton._onClick != null) {
40+
this.refs.radioButton._onClick = null;
41+
this.refs.radioButton.setState({ checked: false});
42+
this.refs.radioButton.refs.radioButton.getDOMNode().checked = false;
43+
}
3944
var toggledState = !this.state.toggled;
4045

4146
this.setState({ toggled: toggledState });
42-
this.refs.radioButton.toggle();
4347

4448
if (this.props.onToggle) this.props.onToggle(e, toggledState);
4549
}

0 commit comments

Comments
 (0)