fix(chat): maintain bottom scroll on input resize

This commit is contained in:
Leonard Kim
2019-05-08 10:45:32 -07:00
committed by virtuacoplenny
parent dfe5fbb702
commit d86b60ea72
3 changed files with 74 additions and 2 deletions

View File

@@ -22,6 +22,12 @@ type Props = {
*/
dispatch: Dispatch<any>,
/**
* Optional callback to invoke when the chat textarea has auto-resized to
* fit overflowing text.
*/
onResize: ?Function,
/**
* Invoked to obtain translated strings.
*/
@@ -120,6 +126,7 @@ class ChatInput extends Component<Props, State> {
inputRef = { this._setTextAreaRef }
maxRows = { 5 }
onChange = { this._onMessageChange }
onHeightChange = { this.props.onResize }
onKeyDown = { this._onDetectSubmit }
placeholder = { this.props.t('chat.messagebox') }
value = { this.state.message } />