Bugfix: Scroll to the bottom more reliably on new incoming messages.

Added some padding to the calculation which means the scrollbar can
be scrolled up a bit and still get bumped down. Scroll a lot though
and it will not keep bumping you down (parity with Angular)
This commit is contained in:
Kegan Dougal 2015-07-22 11:12:45 +01:00
parent e1aca588b5
commit e80cf8a133

View File

@ -114,7 +114,10 @@ module.exports = {
if (this.refs.messageWrapper) {
var messageWrapper = this.refs.messageWrapper.getDOMNode();
this.atBottom = messageWrapper.scrollHeight - messageWrapper.scrollTop <= messageWrapper.clientHeight;
this.atBottom = (
messageWrapper.scrollHeight - messageWrapper.scrollTop <=
(messageWrapper.clientHeight + 150)
);
}
this.setState({
room: MatrixClientPeg.get().getRoom(this.props.roomId)