Skip to content

Commit

Permalink
fix: flush virtualizer until physical count stabilizes (#6684)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomivirkki authored Oct 23, 2023
1 parent a178c0c commit 2767402
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/component-base/src/virtualizer-iron-list-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class IronListAdapter {
}

flush() {
const startPhysicalCount = this._physicalCount;
// The scroll target is hidden.
if (this.scrollTarget.offsetHeight === 0) {
return;
Expand All @@ -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) {
Expand Down

0 comments on commit 2767402

Please sign in to comment.