0
0
Fork 0

Reset textarea height when press submit key (#2681)

* Reset textarea height when press submit key

* dry

* DON'T NEED props
This commit is contained in:
Yamagishi Kazutoshi 2017-05-03 03:08:21 +09:00 committed by Eugen Rochko
parent 302c0d2046
commit 46943b64c6
2 changed files with 6 additions and 3 deletions

View file

@ -44,12 +44,12 @@ class ComposeForm extends React.PureComponent {
handleKeyDown (e) {
if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) {
this.props.onSubmit();
this.handleSubmit();
}
}
handleSubmit () {
this.autosuggestTextarea.textarea.style.height = "auto";
this.autosuggestTextarea.reset();
this.props.onSubmit();
}