Skip to content

Commit

Permalink
fix(Radio): fixed default cannot be selected. remove string refs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 22, 2017
1 parent b9ecf23 commit 287f945
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Radio extends Component {
componentWillReceiveProps(nextProps) {
if (this.props.checked !== nextProps.checked) {
this.setState({ checked: nextProps.checked }, () => {
this.refs.radio.checked = nextProps.checked;
this.radio.checked = nextProps.checked;
})
}
}
Expand All @@ -33,7 +33,7 @@ export default class Radio extends Component {
return (
<label {...other} className={cls}>
<span className={`${prefixCls}-inner`}>
<input ref="radio" type="radio" disabled={disabled} value={value || children} onChange={this.handleChange.bind(this)} />
<input ref={(node) => { this.radio = node }} checked={checked} type="radio" disabled={disabled} value={value || children} onChange={this.handleChange.bind(this)} />
</span>
<span className={`${prefixCls}-text`}>{children || value}</span>
</label>
Expand Down

0 comments on commit 287f945

Please sign in to comment.