mirror of https://github.com/vector-im/riot-web
Limit check on scrollNode.scrollTop to keep firefox happy
Turns out that Firefox ignores attempts to set scrollTop to Number.MAX_VALUE. Clip it to scrollHeight.pull/21833/head
parent
cf17258a6c
commit
422a1f01a4
|
@ -443,10 +443,12 @@ module.exports = React.createClass({
|
|||
var scrollNode = this._getScrollNode();
|
||||
|
||||
var prevScroll = scrollNode.scrollTop;
|
||||
scrollNode.scrollTop = scrollTop;
|
||||
|
||||
// If this change generates a scroll event, we should not update the saved
|
||||
// scroll state on it. See the comments in onScroll.
|
||||
// FF ignores attempts to set scrollTop to very large numbers
|
||||
scrollNode.scrollTop = Math.min(scrollTop, scrollNode.scrollHeight);
|
||||
|
||||
// If this change generates a scroll event, we should not update the
|
||||
// saved scroll state on it. See the comments in onScroll.
|
||||
//
|
||||
// If we *don't* expect a scroll event, we need to leave _lastSetScroll
|
||||
// alone, otherwise we'll end up ignoring a future scroll event which is
|
||||
|
|
Loading…
Reference in New Issue