I have a TextArea component:
<TextArea
ref={this.textInput}
disabled={this.props.disabled || false}
growing
growingMaxLines={3 || growingMaxLines}
maxlength={characterLimit}
height={scrollY}
style={textAreaStyle}
value={this.state.value || this.props.value}
placeholder={this.props.placeholder}
/>
And tried this (React Scroll to bottom of textarea):
constructor (props) {
super(props)
...
this.textInput = React.createRef()
}
componentDidUpdate () {
...
this.textInput.current.scrollTop = this.textInput.current.scrollHeight
}
But the scroll bar does not move to bottom and only the first 3 lines appear as the user speaks and text value grows. Am I missing something?