diff --git a/components/Formsy/Textarea.jsx b/components/Formsy/Textarea.jsx index 4e3f97e76..3df33e735 100644 --- a/components/Formsy/Textarea.jsx +++ b/components/Formsy/Textarea.jsx @@ -16,6 +16,17 @@ class Textarea extends Component { this.props.onChange(this.props.name, value) } + heightChanged(height, instance) { + if(!instance.state || !instance.state._sizeInitialized) { + setTimeout(() => { + instance._resizeComponent() + }) + instance.setState({ + _sizeInitialized: true + }) + } + } + render() { const { label, name, rows, cols, placeholder, wrapperClass} = this.props const hasError = !this.props.isPristine() && !this.props.isValid() @@ -38,6 +49,7 @@ class Textarea extends Component { disabled={disabled} onChange={this.changeValue} value={this.props.getValue()} + onHeightChange={this.heightChanged} /> :