summaryrefslogtreecommitdiffstats
path: root/webapp/components
diff options
context:
space:
mode:
authorDavid Lu <david.lu@hotmail.com>2016-05-31 05:13:43 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-05-31 08:13:43 -0400
commitf920b80e54f83f797a2c2e4fdec527ee701238c1 (patch)
treeaf2439c8b8e5361f91e803d378d1069e3cd26465 /webapp/components
parentdb2ca26a0232d4b324974c010e408a95c3334dfd (diff)
downloadchat-f920b80e54f83f797a2c2e4fdec527ee701238c1.tar.gz
chat-f920b80e54f83f797a2c2e4fdec527ee701238c1.tar.bz2
chat-f920b80e54f83f797a2c2e4fdec527ee701238c1.zip
Fixed endless scrolling up (#3156)
Diffstat (limited to 'webapp/components')
-rw-r--r--webapp/components/sidebar.jsx6
1 files changed, 6 insertions, 0 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx
index d20fef603..28b22fc81 100644
--- a/webapp/components/sidebar.jsx
+++ b/webapp/components/sidebar.jsx
@@ -169,6 +169,12 @@ export default class Sidebar extends React.Component {
$('.sidebar--left .nav-pills__container').perfectScrollbar();
}
+ // reset the scrollbar upon switching teams
+ if (this.state.currentTeam !== prevState.currentTeam) {
+ this.refs.container.scrollTop = 0;
+ $('.nav-pills__container').perfectScrollbar('update');
+ }
+
// close the LHS on mobile when you change channels
if (this.state.activeId !== prevState.activeId) {
$('.app__body .inner-wrap').removeClass('move--right');