Skip to content

Commit 5f7bdb0

Browse files
committed
add disabled property for Input components
1 parent 29e5d3f commit 5f7bdb0

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/Input.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ var Input = React.createClass({
2323
hasFeedback: React.PropTypes.bool,
2424
groupClassName: React.PropTypes.string,
2525
wrapperClassName: React.PropTypes.string,
26-
labelClassName: React.PropTypes.string
26+
labelClassName: React.PropTypes.string,
27+
disabled: React.PropTypes.bool
2728
},
2829

2930
getInputDOMNode: function () {

test/InputSpec.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,13 @@ describe('Input', function () {
163163

164164
assert.equal(instance.getChecked(), true);
165165
});
166+
167+
it('renders a disabled input correctly', function () {
168+
var instance = ReactTestUtils.renderIntoDocument(
169+
<Input type="text" disabled={true} />
170+
);
171+
172+
var node = ReactTestUtils.findRenderedDOMComponentWithTag(instance, 'input').getDOMNode();
173+
assert.isNotNull(node.getAttribute('disabled'));
174+
});
166175
});

0 commit comments

Comments
 (0)