Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/component-base/src/virtualizer-iron-list-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ export class IronListAdapter {
return;
}

this._adjustVirtualIndexOffset(this._scrollTop - (this.__previousScrollTop || 0));
const delta = this.scrollTarget.scrollTop - this._scrollPosition;
this._adjustVirtualIndexOffset(this._scrollTop - this._scrollPosition);
const delta = this._scrollTop - this._scrollPosition;

super._scrollHandler();

Expand Down Expand Up @@ -601,11 +601,9 @@ export class IronListAdapter {
);
}

this.__previousScrollTop = this._scrollTop;
Copy link
Contributor Author

@vursen vursen Sep 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_scrollTop reads the actual scrollTop value from the DOM, which can force a style recalculation if done immediately after style writes.


// If the first visible index is not 0 when scrolled to the top,
// scroll to index 0 to fix the issue.
if (this._scrollTop === 0 && this.firstVisibleIndex !== 0 && Math.abs(delta) > 0) {
if (this._scrollPosition === 0 && this.firstVisibleIndex !== 0 && Math.abs(delta) > 0) {
this.scrollToIndex(0);
}
}
Expand Down