Comment + 1

pull/21833/head
David Baker 2015-12-04 12:02:54 +00:00
parent 141d757a01
commit 6a67342d02
1 changed files with 1 additions and 0 deletions

View File

@ -362,6 +362,7 @@ module.exports = React.createClass({
if (this.refs.messagePanel) {
var messageWrapperScroll = this._getScrollNode();
var wasAtBottom = this.atBottom;
// + 1 here to avoid fractional pixel rounding errors
this.atBottom = messageWrapperScroll.scrollHeight - messageWrapperScroll.scrollTop <= messageWrapperScroll.clientHeight + 1;
if (this.atBottom && !wasAtBottom) {
this.forceUpdate(); // remove unread msg count