From d9640f191eb287f4df70b6af9b3a0ce3d2710c93 Mon Sep 17 00:00:00 2001 From: Jerson Otzoy Date: Tue, 18 Nov 2014 05:48:50 -0600 Subject: [PATCH 1/3] update Radio Button behavior in Paper Toggle This is for issue #73 the problem was that the onClick event of the radio button associated to the toggle was triggered too, I removed the onClick from the radio button associated to the toggle --- src/js/toggle.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/toggle.jsx b/src/js/toggle.jsx index 272c4352d9b136..ed401fa90b9dbf 100644 --- a/src/js/toggle.jsx +++ b/src/js/toggle.jsx @@ -36,10 +36,10 @@ var Toggle = React.createClass({ }, _onClick: function(e) { + if (this.refs.radioButton._onClick != null) this.refs.radioButton._onClick = null; var toggledState = !this.state.toggled; this.setState({ toggled: toggledState }); - this.refs.radioButton.toggle(); if (this.props.onToggle) this.props.onToggle(e, toggledState); } From ad7079137c960fce2bacef823f5784ff6d04a30b Mon Sep 17 00:00:00 2001 From: Jersonodev Date: Tue, 18 Nov 2014 05:53:47 -0600 Subject: [PATCH 2/3] Update toggle.jsx --- src/js/toggle.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/toggle.jsx b/src/js/toggle.jsx index ed401fa90b9dbf..1b843943f07953 100644 --- a/src/js/toggle.jsx +++ b/src/js/toggle.jsx @@ -36,7 +36,7 @@ var Toggle = React.createClass({ }, _onClick: function(e) { - if (this.refs.radioButton._onClick != null) this.refs.radioButton._onClick = null; + if (this.refs.radioButton._onClick != null) this.refs.radioButton._onClick = null; var toggledState = !this.state.toggled; this.setState({ toggled: toggledState }); From 81d3a11b7d222a32c052e40a54a35994b663cd1c Mon Sep 17 00:00:00 2001 From: Jerson Otzoy Date: Tue, 18 Nov 2014 07:57:37 -0600 Subject: [PATCH 3/3] #70 update radio button on toggle This is for issue #70 the problem was that the onClick event of the radio button associated to the toggle was triggered too, I removed the onClick from the radio button associated to the toggle but it wasn't enough as if the user clicked first the radio button it would change to true, now it is propperly fixed and tested --- src/js/toggle.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/toggle.jsx b/src/js/toggle.jsx index 1b843943f07953..541dc25c9728e9 100644 --- a/src/js/toggle.jsx +++ b/src/js/toggle.jsx @@ -36,7 +36,11 @@ var Toggle = React.createClass({ }, _onClick: function(e) { - if (this.refs.radioButton._onClick != null) this.refs.radioButton._onClick = null; + 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 });