Merge pull request #3653 from KDSBrowne/Chat-Scroll

HTML5 - Chat scroll fix
This commit is contained in:
Anton Georgiev 2017-02-10 13:51:53 -05:00 committed by GitHub
commit ac140be59a

View File

@ -78,10 +78,13 @@ class MessageList extends Component {
}
const { scrollArea } = this.refs;
this.shouldScrollBottom = scrollArea.scrollTop +
scrollArea.offsetHeight ===
scrollArea.scrollHeight;
let position = scrollArea.scrollTop + scrollArea.offsetHeight;
//Compare with <1 to account for the chance scrollArea.scrollTop is a float
//value in some browsers.
this.shouldScrollBottom = position === scrollArea.scrollHeight ||
(scrollArea.scrollHeight - position < 1);
}
componentDidUpdate(prevProps) {