Skip to content

Commit b441efa

Browse files
authored
Merge pull request #284 from afrisalyp/feature/connectv2-textautoresize
connect-app bug bash #1368 Feature/connectv2
2 parents b840167 + 6309211 commit b441efa

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

components/Formsy/Textarea.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ class Textarea extends Component {
1616
this.props.onChange(this.props.name, value)
1717
}
1818

19+
heightChanged(height, instance) {
20+
if(!instance.state || !instance.state._sizeInitialized) {
21+
setTimeout(() => {
22+
instance._resizeComponent()
23+
})
24+
instance.setState({
25+
_sizeInitialized: true
26+
})
27+
}
28+
}
29+
1930
render() {
2031
const { label, name, rows, cols, placeholder, wrapperClass} = this.props
2132
const hasError = !this.props.isPristine() && !this.props.isValid()
@@ -38,6 +49,7 @@ class Textarea extends Component {
3849
disabled={disabled}
3950
onChange={this.changeValue}
4051
value={this.props.getValue()}
52+
onHeightChange={this.heightChanged}
4153
/> :
4254
<textarea
4355
rows={rows}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"react-router-dom": "^4.2.2",
8282
"react-select": "^0.9.1",
8383
"react-switch-button": "^1.1.2",
84-
"react-textarea-autosize": "^4.0.5",
84+
"react-textarea-autosize": "^5.2.1",
8585
"react-transition-group": "^2.2.1",
8686
"redux-thunk": "^2.1.0",
8787
"tc-ui": "git+https://github.com/appirio-tech/tc-ui.git#feature/connectv2",

0 commit comments

Comments
 (0)