about summary refs log tree commit diff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorgeta6 <getakura@gmail.com>2017-04-19 22:39:46 +0900
committerEugen <eugen@zeonfederated.com>2017-04-19 15:39:46 +0200
commit15a4fc5dcc8e7a6b51ba5c33e921f0e9b70a0c6e (patch)
tree17ac0d650edd88b1513835fd6357a028a49eb153 /app/assets/javascripts
parenta8e1afc30a1f843943bb29e7385b8611ea3c29f4 (diff)
Automatically change the size of textarea (#2128)
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/components/components/autosuggest_textarea.jsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/assets/javascripts/components/components/autosuggest_textarea.jsx b/app/assets/javascripts/components/components/autosuggest_textarea.jsx
index 04328aae8..7c068955a 100644
--- a/app/assets/javascripts/components/components/autosuggest_textarea.jsx
+++ b/app/assets/javascripts/components/components/autosuggest_textarea.jsx
@@ -63,6 +63,10 @@ const AutosuggestTextarea = React.createClass({
       this.props.onSuggestionsClearRequested();
     }
 
+    // auto-resize textarea
+    e.target.style.height = 'auto';
+    e.target.style.height = `${e.target.scrollHeight}px`;
+
     this.props.onChange(e);
   },