Skip to content

Commit a9b1afd

Browse files
Mr-KRAMAmmalerba
authored andcommitted
fix(cdk/scrolling): prevent subpixel gaps in virtual scroll viewport (#31940)
Co-authored-by: MR-KRAMA <[email protected]> (cherry picked from commit 2918e28)
1 parent 7c3eac5 commit a9b1afd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cdk/scrolling/fixed-size-virtual-scroll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {
174174
}
175175

176176
this._viewport.setRenderedRange(newRange);
177-
this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);
177+
this._viewport.setRenderedContentOffset(Math.round(this._itemSize * newRange.start));
178178
this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));
179179
}
180180
}

0 commit comments

Comments
 (0)