about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-08-17 14:07:38 +0200
committerEugen Rochko <eugen@zeonfederated.com>2018-08-17 14:07:38 +0200
commit4601a58ac24f2c97ba4934445da694ca18308b81 (patch)
tree52666d3d2fc871278f2982d4f03f8c2dc9342b5d
parent106fa28a00ae9b336c05a25b800b9897bd61820d (diff)
Defer scrollIntoView after DOM is drawn (fixes #8239) (#8242)
-rw-r--r--app/javascript/mastodon/features/status/index.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js
index 89387ca43..0ffeaa4dc 100644
--- a/app/javascript/mastodon/features/status/index.js
+++ b/app/javascript/mastodon/features/status/index.js
@@ -355,7 +355,9 @@ export default class Status extends ImmutablePureComponent {
     if (status && ancestorsIds && ancestorsIds.size > 0) {
       const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size - 1];
 
-      element.scrollIntoView(true);
+      window.requestAnimationFrame(() => {
+        element.scrollIntoView(true);
+      });
       this._scrolledIntoView = true;
     }
   }