about summary refs log tree commit diff
path: root/app/javascript/mastodon/features/ui/components/columns_area.js
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>2017-08-29 21:16:21 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-08-29 14:16:21 +0200
commit9958eba356210f1d0b89db368e17bbd72358e097 (patch)
treec407c24940524c0b1db166c1d1e650fe4acfc429 /app/javascript/mastodon/features/ui/components/columns_area.js
parent0827c09c448ea8d61e62534dd3547719e148a4ae (diff)
Do not scroll the columns area due to redirection (#4541)
Commit 9d1f8b9d6af1d384a4dd68bc6353a2fde5735b33 scrolls the columns area
when the route changes since the user is likely to want to see the
rightmost column in such cases.

However, redirection is automatic and does not indicate users' intension.
Do not scroll the columns area due to one.
Diffstat (limited to 'app/javascript/mastodon/features/ui/components/columns_area.js')
-rw-r--r--app/javascript/mastodon/features/ui/components/columns_area.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/javascript/mastodon/features/ui/components/columns_area.js b/app/javascript/mastodon/features/ui/components/columns_area.js
index 47d5a2e20..de3a199c7 100644
--- a/app/javascript/mastodon/features/ui/components/columns_area.js
+++ b/app/javascript/mastodon/features/ui/components/columns_area.js
@@ -24,7 +24,7 @@ const componentMap = {
   'FAVOURITES': FavouritedStatuses,
 };
 
-@injectIntl
+@component => injectIntl(component, { withRef: true })
 export default class ColumnsArea extends ImmutablePureComponent {
 
   static contextTypes = {
@@ -51,13 +51,13 @@ export default class ColumnsArea extends ImmutablePureComponent {
     this.setState({ shouldAnimate: true });
   }
 
-  componentDidUpdate(prevProps) {
+  componentDidUpdate() {
     this.lastIndex = getIndex(this.context.router.history.location.pathname);
     this.setState({ shouldAnimate: true });
+  }
 
-    if (this.props.children !== prevProps.children && !this.props.singleColumn) {
-      scrollRight(this.node);
-    }
+  handleChildrenContentChange() {
+    scrollRight(this.node);
   }
 
   handleSwipe = (index) => {