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.
This commit is contained in:
lilia 2015-08-27 16:25:33 -07:00
parent e3c56a0c03
commit 9e79ecddf8

View file

@ -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;