1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-07-19 20:23:18 +03:00

round scrollTop upwards to prevent never detecting bottom

This commit is contained in:
Bruno Windels
2019-03-29 16:41:10 +01:00
parent a326c83016
commit 8e4a06db77

View File

@ -222,7 +222,10 @@ module.exports = React.createClass({
// whether it will stay that way when the children update.
isAtBottom: function() {
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