about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components
diff options
context:
space:
mode:
authorJeong Arm <kjwonmail@gmail.com>2019-06-05 22:29:45 +0900
committermultiple creatures <dev@multiple-creature.party>2019-11-19 16:39:22 -0600
commit924e5357795067bf6eb78f9ed3f4615ffaa1f5d4 (patch)
tree2927c77f0c9c2eb16b6525cfec9e85ec588640d2 /app/javascript/flavours/glitch/components
parentb2f3fd782ba1b67f424168246a1d7338313c4caa (diff)
[Glitch] Scroll to compose form when focus
Port 8f3c32e29cf13a84b2f0a58da0ab0c99a88caad5 to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/components')
-rw-r--r--app/javascript/flavours/glitch/components/autosuggest_textarea.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
index e1ded2b3a..cf3907fbf 100644
--- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js
+++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js
@@ -138,8 +138,11 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
     this.setState({ suggestionsHidden: true, focused: false });
   }
 
-  onFocus = () => {
+  onFocus = (e) => {
     this.setState({ focused: true });
+    if (this.props.onFocus) {
+      this.props.onFocus(e);
+    }
   }
 
   onSuggestionClick = (e) => {