From ca8d57c4dbfe839db28b583caa7d599c0cfc023a Mon Sep 17 00:00:00 2001
From: Joram Wilander <jwawilander@gmail.com>
Date: Fri, 23 Jun 2017 12:09:56 -0400
Subject: PLT-6890 Fix various scrolling issues (#6727)

* Fix various scrolling issues

* Move reaction scrolling to reaction list

* Handle scrolling when RHS opens

* Only run scroll update code when posts change
---
 webapp/components/sidebar_right/sidebar_right.jsx | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

(limited to 'webapp/components/sidebar_right/sidebar_right.jsx')

diff --git a/webapp/components/sidebar_right/sidebar_right.jsx b/webapp/components/sidebar_right/sidebar_right.jsx
index 00a7d2d25..f48bcaa56 100644
--- a/webapp/components/sidebar_right/sidebar_right.jsx
+++ b/webapp/components/sidebar_right/sidebar_right.jsx
@@ -15,6 +15,7 @@ import WebrtcStore from 'stores/webrtc_store.jsx';
 
 import {getFlaggedPosts, getPinnedPosts} from 'actions/post_actions.jsx';
 import {trackEvent} from 'actions/diagnostics_actions.jsx';
+import {postListScrollChange} from 'actions/global_actions.jsx';
 
 import * as Utils from 'utils/utils.jsx';
 import Constants from 'utils/constants.jsx';
@@ -120,10 +121,16 @@ export default class SidebarRight extends React.Component {
         return null;
     }
 
-    componentDidUpdate() {
+    componentDidUpdate(prevProps, prevState) {
         const isOpen = this.state.searchVisible || this.props.postRightVisible;
         WebrtcStore.emitRhsChanged(isOpen);
         this.doStrangeThings();
+
+        const wasOpen = prevState.searchVisible || prevProps.postRightVisible;
+
+        if (isOpen && !wasOpen) {
+            postListScrollChange();
+        }
     }
 
     onPreferenceChange() {
-- 
cgit v1.2.3-1-g7c22

