From 20fc9ae34329f6f02ba32f4a239d2ac1a9172310 Mon Sep 17 00:00:00 2001 From: or-else Date: Wed, 20 Sep 2017 12:00:54 -0700 Subject: [PATCH] scroll only on material changes --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 14ebb42d..ec4501f0 100644 --- a/index.html +++ b/index.html @@ -2358,8 +2358,9 @@ }, // Scroll last message into view on component update e.g. on message received. - componentDidUpdate: function() { - if (this.messagesScroller) { + componentDidUpdate: function(prevProps, prevState) { + if (this.messagesScroller && + (prevState.title != this.state.title || prevState.messages.length != this.state.messages.length)) { this.messagesScroller.scrollTop = this.messagesScroller.scrollHeight - this.state.scrollPosition; } }, @@ -2415,7 +2416,6 @@ topic: props.topic, scrollPosition: 0 }); - tryToResubscribe = true; }