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)
pull/2/head
Kegan Dougal 2015-07-22 11:12:45 +01:00
parent e1aca588b5
commit e80cf8a133
1 changed files with 4 additions and 1 deletions

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)