Skip to content

Commit

Permalink
Fixed #14
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Apr 10, 2017
1 parent 7a4c3b7 commit 8427add
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/radiobutton/RadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ export class RadioButton extends Component {
this.onClick = this.onClick.bind(this);
}

select(e) {
this.input.checked = true;
this.onClick(e);
}

onClick(e) {
if(this.props.onChange) {
this.props.onChange({
Expand All @@ -40,14 +45,14 @@ export class RadioButton extends Component {
<div className={classNames('ui-radiobutton-container', this.props.className)}>
<div className='ui-radiobutton ui-widget'>
<div className="ui-helper-hidden-accessible">
<input type="radio" />
<input ref={(el) => this.input = el} type="radio" />
</div>
<div className={boxClass}
onClick={this.onClick}>
<span className={iconClass}></span>
</div>
</div>
{this.props.label && <label className="ui-radiobutton-label">{this.props.label}</label>}
{this.props.label && <label className="ui-radiobutton-label" onClick={this.select.bind(this)}>{this.props.label}</label>}
</div>
)
}
Expand Down

0 comments on commit 8427add

Please sign in to comment.