Skip to content

Commit 2918e28

Browse files
authored
fix(cdk/scrolling): prevent subpixel gaps in virtual scroll viewport (angular#31940)
Co-authored-by: MR-KRAMA <[email protected]>
1 parent 68749dd commit 2918e28

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)