Skip to content

Commit

Permalink
fix(Radio): Radio checked can not be undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Nov 22, 2017
1 parent 03516d7 commit 1319139
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/radio/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ export default class Radio extends Component {
'disabled': disabled, // 禁用状态
'checked': checked, // 选中
});
const inputProps = {
ref: (node) => { this.radio = node },
type: 'radio',
disabled: disabled,
checked: checked || false,
value: value || children,
onChange: this.handleChange.bind(this),
}
return (
<label {...other} className={cls}>
<span className={`${prefixCls}-inner`}>
<input ref={(node) => { this.radio = node }} checked={checked} type="radio" disabled={disabled} value={value || children} onChange={this.handleChange.bind(this)} />
<input {...inputProps} />
</span>
<span className={`${prefixCls}-text`}>{children || value}</span>
</label>
Expand Down

0 comments on commit 1319139

Please sign in to comment.