about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorOndřej Hruška <ondra@ondrovo.com>2017-10-11 21:49:22 +0200
committerOndřej Hruška <ondra@ondrovo.com>2017-10-11 21:49:22 +0200
commitb0b5ff1b0f0a1422e85e7059df598e2b89bd657e (patch)
tree61c716e3bb1dd54ab2edc4f0d72afe56b2939c13 /app
parentbd51a16150593f79631164fc75b3d289f861b74c (diff)
workaround for scrollIntoView bug ???
Diffstat (limited to 'app')
-rw-r--r--app/javascript/mastodon/features/status/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js
index 656226fca..c40630a0a 100644
--- a/app/javascript/mastodon/features/status/index.js
+++ b/app/javascript/mastodon/features/status/index.js
@@ -252,8 +252,10 @@ export default class Status extends ImmutablePureComponent {
     if (status && ancestorsIds && ancestorsIds.size > 0) {
       const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size - 1];
 
-      element.scrollIntoView(true);
-      this._scrolledIntoView = true;
+      if (element) {
+        element.scrollIntoView(true);
+        this._scrolledIntoView = true;
+      }
     }
   }