diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-06-23 12:09:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 12:09:56 -0400 |
commit | ca8d57c4dbfe839db28b583caa7d599c0cfc023a (patch) | |
tree | 0a4fc6eabf8b8d7f87fdb687b03cc4da7e48d2c3 /webapp/components/sidebar_right | |
parent | b01da39887b990b8c57484f53643a3c0ea5d531b (diff) | |
download | chat-ca8d57c4dbfe839db28b583caa7d599c0cfc023a.tar.gz chat-ca8d57c4dbfe839db28b583caa7d599c0cfc023a.tar.bz2 chat-ca8d57c4dbfe839db28b583caa7d599c0cfc023a.zip |
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
Diffstat (limited to 'webapp/components/sidebar_right')
-rw-r--r-- | webapp/components/sidebar_right/sidebar_right.jsx | 9 |
1 files changed, 8 insertions, 1 deletions
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() { |