Make the unpagination process less aggressive
This increases `UNPAGINATION_PADDING` (see the ASCII on ScrollPanel.js, `_getExcessHeight`), and also debounces unfilling requests made for 200ms. This forces unfilling requests not to be sent unless the next 200ms has no scrolling, effectively.
This commit is contained in:
parent
06f12b91b8
commit
d1a5d94916
1 changed files with 9 additions and 2 deletions
|
@ -25,7 +25,7 @@ var DEBUG_SCROLL = false;
|
|||
|
||||
// The amount of extra scroll distance to allow prior to unfilling.
|
||||
// See _getExcessHeight.
|
||||
const UNPAGINATION_PADDING = 500;
|
||||
const UNPAGINATION_PADDING = 1500;
|
||||
|
||||
if (DEBUG_SCROLL) {
|
||||
// using bind means that we get to keep useful line numbers in the console
|
||||
|
@ -361,7 +361,14 @@ module.exports = React.createClass({
|
|||
}
|
||||
|
||||
if (markerScrollToken) {
|
||||
this.props.onUnfillRequest(backwards, markerScrollToken);
|
||||
// Use a debouncer to prevent multiple unfill calls in quick succession
|
||||
// This is to make the unfilling process less aggressive
|
||||
if (this._unfillDebouncer) {
|
||||
clearTimeout(this._unfillDebouncer);
|
||||
}
|
||||
this._unfillDebouncer = setTimeout(() => {
|
||||
this.props.onUnfillRequest(backwards, markerScrollToken);
|
||||
}, 200);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue