Skip to content

Commit f8ef8e3

Browse files
author
Emmanouil Konstantinidis
committed
Clean up
1 parent da10ce4 commit f8ef8e3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

rest_framework_docs/static/rest_framework_docs/js/components/fields/boolean.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ var FieldBoolean = React.createClass({
1616
this.props.onChange(value);
1717
},
1818

19-
isChecked: function () {
19+
isChecked: function (value) {
2020
if (this.props.value === undefined) return;
21+
return this.props.value === value;
2122
},
2223

2324
render: function () {
@@ -41,15 +42,13 @@ var FieldBoolean = React.createClass({
4142
<input
4243
type='radio'
4344
name={this.props.name}
44-
value='True'
4545
checked={this.isChecked(true)}
4646
onChange={this.handleChange.bind(this, true)} /> True
4747
</label>
4848
<label className='radio-inline'>
4949
<input
5050
type='radio'
5151
name={this.props.name}
52-
value='False'
5352
checked={this.isChecked(false)}
5453
onChange={this.handleChange.bind(this, false)} /> False
5554
</label>

0 commit comments

Comments
 (0)