mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-25 16:31:37 +02:00
Merge pull request #2846 from matrix-org/bwindels/atbottomfix
round scrollTop upwards to prevent never detecting bottom
This commit is contained in:
commit
e7852ad1b4
@ -222,7 +222,10 @@ module.exports = React.createClass({
|
|||||||
// whether it will stay that way when the children update.
|
// whether it will stay that way when the children update.
|
||||||
isAtBottom: function() {
|
isAtBottom: function() {
|
||||||
const sn = this._getScrollNode();
|
const sn = this._getScrollNode();
|
||||||
return sn.scrollTop === sn.scrollHeight - sn.clientHeight;
|
// fractional values for scrollTop happen on certain browsers/platforms
|
||||||
|
// when scrolled all the way down. E.g. Chrome 72 on debian.
|
||||||
|
// so ceil everything upwards to make sure it aligns.
|
||||||
|
return Math.ceil(sn.scrollTop) === Math.ceil(sn.scrollHeight - sn.clientHeight);
|
||||||
},
|
},
|
||||||
|
|
||||||
// returns the vertical height in the given direction that can be removed from
|
// returns the vertical height in the given direction that can be removed from
|
||||||
|
Loading…
x
Reference in New Issue
Block a user