From e80cf8a1336a2df20bcae25bbf5b17331432c2bf Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 22 Jul 2015 11:12:45 +0100 Subject: [PATCH] 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) --- src/controllers/organisms/RoomView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/organisms/RoomView.js b/src/controllers/organisms/RoomView.js index c6a0735b..7c3a3d0a 100644 --- a/src/controllers/organisms/RoomView.js +++ b/src/controllers/organisms/RoomView.js @@ -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)