about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--app/javascript/mastodon/features/status/index.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/status/index.js b/app/javascript/mastodon/features/status/index.js
index 83e83540a..abcfee99e 100644
--- a/app/javascript/mastodon/features/status/index.js
+++ b/app/javascript/mastodon/features/status/index.js
@@ -242,8 +242,8 @@ export default class Status extends ImmutablePureComponent {
   componentDidUpdate () {
     const { ancestorsIds } = this.props;
 
-    if (ancestorsIds) {
-      const element = this.node.querySelectorAll('.focusable')[this.props.ancestorsIds.size];
+    if (ancestorsIds && ancestorsIds.size > 0) {
+      const element = this.node.querySelectorAll('.focusable')[ancestorsIds.size];
       element.scrollIntoView();
     }
   }