diff --git a/src/addons/TextArea/TextArea.js b/src/addons/TextArea/TextArea.js index 0fb75739ca..cd24ba9804 100644 --- a/src/addons/TextArea/TextArea.js +++ b/src/addons/TextArea/TextArea.js @@ -54,6 +54,8 @@ class TextArea extends Component { } } + focus = () => (this.ref.focus()) + handleChange = (e) => { const { onChange } = this.props if (onChange) onChange(e, { ...this.props, value: e.target && e.target.value }) diff --git a/test/specs/addons/TextArea/TextArea-test.js b/test/specs/addons/TextArea/TextArea-test.js index 454614ee22..36e1c3979d 100644 --- a/test/specs/addons/TextArea/TextArea-test.js +++ b/test/specs/addons/TextArea/TextArea-test.js @@ -40,18 +40,13 @@ describe('TextArea', () => { }, }) - describe('onChange', () => { - it('is called with (e, data) on change', () => { - const spy = sandbox.spy() - const e = { target: { value: 'name' } } - const props = { 'data-foo': 'bar', onChange: spy } - - wrapperShallow(