Skip to content

Commit

Permalink
update Radio Button behavior in Paper Toggle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jerson Otzoy committed Nov 18, 2014
1 parent 89e690d commit d9640f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/toggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

2 comments on commit d9640f1

@iurevych
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey guys, how do you pass a default checked attribute for the RadioButton component (i.e. [ ] Off [x] On | [x] Off [ ] On)?

Seems like an obvious thing, but now I'm forced to add support for checked @props, is there a better way?

@iurevych
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, it works, thanks!

Please sign in to comment.