diff --git a/packages/component-base/src/virtualizer-iron-list-adapter.js b/packages/component-base/src/virtualizer-iron-list-adapter.js index 78f0c27e15..3c1aeafc0f 100644 --- a/packages/component-base/src/virtualizer-iron-list-adapter.js +++ b/packages/component-base/src/virtualizer-iron-list-adapter.js @@ -136,6 +136,7 @@ export class IronListAdapter { } flush() { + const startPhysicalCount = this._physicalCount; // The scroll target is hidden. if (this.scrollTarget.offsetHeight === 0) { return; @@ -153,6 +154,11 @@ export class IronListAdapter { if (this.__debouncerWheelAnimationFrame) { this.__debouncerWheelAnimationFrame.flush(); } + + if (this._physicalCount !== startPhysicalCount) { + // Flushing again until physical count stabilizes fixes https://github.com/vaadin/flow-components/issues/5595#issuecomment-1770278913 + this.flush(); + } } update(startIndex = 0, endIndex = this.size - 1) {