about summary refs log tree commit diff
path: root/app/javascript/flavours
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-17 13:39:06 +0200
committerThibG <thib@sitedethib.com>2018-08-17 14:46:37 +0200
commit4a6bc2482a26aa0441485ca360a3d3c0eeea7fe4 (patch)
tree68cd048dd09d8a6cea22220b9b90da2cdfe8b772 /app/javascript/flavours
parent50cd70b3e9e72e73cc7e55305dcf7810fa5393c8 (diff)
[Glitch] Defer scrollIntoView after DOM is drawn
Diffstat (limited to 'app/javascript/flavours')
-rw-r--r--app/javascript/flavours/glitch/features/status/index.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js
index e1330b183..ddc2f820a 100644
--- a/app/javascript/flavours/glitch/features/status/index.js
+++ b/app/javascript/flavours/glitch/features/status/index.js
@@ -327,10 +327,10 @@ export default class Status extends ImmutablePureComponent {
     if (status && ancestorsIds && ancestorsIds.size > 0) {
       const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size - 1];
 
-      if (element) {
+      window.requestAnimationFrame(() => {
         element.scrollIntoView(true);
-        this._scrolledIntoView = true;
-      }
+      });
+      this._scrolledIntoView = true;
     }
   }