From da715c70b0ec3b5f53b0db6ff437c3cda358f8b2 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Wed, 11 Aug 2021 12:37:07 +0530 Subject: [PATCH] Remove forceRender Signed-off-by: RMidhunSuresh --- src/platform/web/ui/general/LazyListView.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/platform/web/ui/general/LazyListView.js b/src/platform/web/ui/general/LazyListView.js index 2c070d95..00e9b9d8 100644 --- a/src/platform/web/ui/general/LazyListView.js +++ b/src/platform/web/ui/general/LazyListView.js @@ -139,17 +139,12 @@ export class LazyListView extends ListView { return new ItemRange(topCount, renderCount, bottomCount); } - _renderIfNeeded(forceRender = false) { - /* - forceRender only because we don't optimize onAdd/onRemove yet. - Ideally, onAdd/onRemove should only render whatever has changed + update padding + update renderRange - */ + _renderIfNeeded() { const range = this._getVisibleRange(); const intersectRange = range.expand(this._overflowMargin); const renderRange = range.expand(this._overflowItems); // only update render Range if the new range + overflowMargin isn't contained by the old anymore - // or if we are force rendering - if (forceRender || !this._renderRange.contains(intersectRange)) { + if (!this._renderRange.contains(intersectRange)) { console.log("new", renderRange); console.log("current", this._renderRange); console.log("diff", this._renderRange.diff(renderRange));