mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
allow fractional values for scrollTop above and below expected value
This commit is contained in:
parent
d92336fc16
commit
726e91101a
1 changed files with 5 additions and 3 deletions
|
@ -222,10 +222,12 @@ module.exports = React.createClass({
|
|||
// whether it will stay that way when the children update.
|
||||
isAtBottom: function() {
|
||||
const sn = this._getScrollNode();
|
||||
// fractional values for scrollTop happen on certain browsers/platforms
|
||||
// fractional values (both too big and too small)
|
||||
// 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);
|
||||
// so check difference <= 1;
|
||||
return Math.abs(sn.scrollHeight - (sn.scrollTop + sn.clientHeight)) <= 1;
|
||||
|
||||
},
|
||||
|
||||
// returns the vertical height in the given direction that can be removed from
|
||||
|
|
Loading…
Reference in a new issue