forked from matrix/element-web
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:
parent
e1aca588b5
commit
e80cf8a133
|
@ -114,7 +114,10 @@ module.exports = {
|
||||||
|
|
||||||
if (this.refs.messageWrapper) {
|
if (this.refs.messageWrapper) {
|
||||||
var messageWrapper = this.refs.messageWrapper.getDOMNode();
|
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({
|
this.setState({
|
||||||
room: MatrixClientPeg.get().getRoom(this.props.roomId)
|
room: MatrixClientPeg.get().getRoom(this.props.roomId)
|
||||||
|
|
Loading…
Reference in New Issue