fix(virtual-scroll): properly calculate top offset when nested (#21581)

This commit is contained in:
Christian Lüdemann
2020-07-20 16:29:39 +02:00
committed by GitHub
parent a625c837a6
commit d297ecb87a

View File

@ -266,7 +266,7 @@ export class VirtualScroll implements ComponentInterface {
let node: HTMLElement | null = el;
while (node && node !== contentEl) {
topOffset += node.offsetTop;
node = node.parentElement;
node = node.offsetParent as HTMLElement;
}
this.viewportOffset = topOffset;
if (scrollEl) {