mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Remove forceRender
Signed-off-by: RMidhunSuresh <rmidhunsuresh@gmail.com>
This commit is contained in:
parent
e10b494f0c
commit
da715c70b0
@ -139,17 +139,12 @@ export class LazyListView extends ListView {
|
|||||||
return new ItemRange(topCount, renderCount, bottomCount);
|
return new ItemRange(topCount, renderCount, bottomCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
_renderIfNeeded(forceRender = false) {
|
_renderIfNeeded() {
|
||||||
/*
|
|
||||||
forceRender only because we don't optimize onAdd/onRemove yet.
|
|
||||||
Ideally, onAdd/onRemove should only render whatever has changed + update padding + update renderRange
|
|
||||||
*/
|
|
||||||
const range = this._getVisibleRange();
|
const range = this._getVisibleRange();
|
||||||
const intersectRange = range.expand(this._overflowMargin);
|
const intersectRange = range.expand(this._overflowMargin);
|
||||||
const renderRange = range.expand(this._overflowItems);
|
const renderRange = range.expand(this._overflowItems);
|
||||||
// only update render Range if the new range + overflowMargin isn't contained by the old anymore
|
// only update render Range if the new range + overflowMargin isn't contained by the old anymore
|
||||||
// or if we are force rendering
|
if (!this._renderRange.contains(intersectRange)) {
|
||||||
if (forceRender || !this._renderRange.contains(intersectRange)) {
|
|
||||||
console.log("new", renderRange);
|
console.log("new", renderRange);
|
||||||
console.log("current", this._renderRange);
|
console.log("current", this._renderRange);
|
||||||
console.log("diff", this._renderRange.diff(renderRange));
|
console.log("diff", this._renderRange.diff(renderRange));
|
||||||
|
Loading…
Reference in New Issue
Block a user