From d92ff92fb25b903e346be4008896f57507575d82 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 4 Mar 2020 11:33:19 -0800 Subject: [PATCH] Improve comment. --- lib/elements/dom-repeat.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/elements/dom-repeat.js b/lib/elements/dom-repeat.js index 7b2d1dbee2..27d2f79728 100644 --- a/lib/elements/dom-repeat.js +++ b/lib/elements/dom-repeat.js @@ -544,7 +544,10 @@ export class DomRepeat extends domRepeatBase { const limit = this.__calculateLimit(isntIdxToItemsIdx.length); // Create, update, and/or remove instances this.__updateInstances(items, limit, isntIdxToItemsIdx); - // If we're chunking, schedule a rAF task to measure/continue chunking + // If we're chunking, schedule a rAF task to measure/continue chunking. + // Do this before any notifying events (renderedItemCount & dom-change) + // since those could modify items and enqueue a new full render which will + // pre-empt this measurement. if (this.initialCount && (this.__shouldMeasureChunk || this.__shouldContinueChunking)) { this.__debounceRender(this.__continueChunkingAfterRaf);