Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 13282c5

Browse files
committed
fix(template): properly size the virtual viewport container
account for the sentinels size when sizing the virtual viewport. Before a scrollbar was shown even though the items would perfectly fit without one
1 parent 1c087fb commit 13282c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/template/experimental/virtual-scrolling/src/lib/virtual-scroll-viewport.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ export class RxVirtualScrollViewportComponent
228228
if (this.scrollElement) {
229229
this.elementRef.nativeElement.style.height = `${size}px`;
230230
} else {
231-
this.scrollSentinel.nativeElement.style.transform = `translate(0, ${size}px)`;
231+
this.scrollSentinel.nativeElement.style.transform = `translate(0, ${
232+
size - 1
233+
}px)`;
232234
}
233235
}
234236
}

0 commit comments

Comments
 (0)