Skip to content

Commit

Permalink
fix checkbox default toString() bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenFang committed Nov 6, 2015
1 parent 6b9f544 commit f8ad7a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ var Editor=function(editable, attr, format, editorClass, defaultValue){
attr.className = attr.className.replace('form-control','');
attr.className += ' checkbox pull-right';

let checked = defaultValue.toString() == values.split(':')[0]?true:false;
let checked = defaultValue && defaultValue.toString() == values.split(':')[0]?true:false;

return (
<input {...attr} type='checkbox' value={values} defaultChecked={checked}/>
Expand Down

0 comments on commit f8ad7a2

Please sign in to comment.