From 9e79ecddf858d5eeb57b4ab18653b26029e2b1df Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 27 Aug 2015 16:25:33 -0700 Subject: [PATCH] Fix scroll stickiness while hidden Fix bug: Open thread A, open thread B, receive message in thread A, open thread A. Scroll bar has reset to the top. --- js/views/message_list_view.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/views/message_list_view.js b/js/views/message_list_view.js index 86006336..89d77f2f 100644 --- a/js/views/message_list_view.js +++ b/js/views/message_list_view.js @@ -32,6 +32,9 @@ this.scrollToBottom(); }, measureScrollPosition: function() { + if (this.el.scrollHeight === 0) { // hidden + return; + } this.scrollPosition = this.$el.scrollTop() + this.$el.outerHeight(); this.scrollHeight = this.el.scrollHeight; this.shouldStickToBottom = this.scrollPosition === this.scrollHeight;