When an element to highlight is outside of the initial window (and needs to be scrolled to), the overlay covers this element.
It appears that the svg path of the overlay is calculated using _getVisibleHeight(), which returns 0 in that case.
This seems to be due to the fact that _getVisibleHeight() uses scrollParent.getBoundingClientRect(), without taking window.scrollY into account. The modification of _getVisibleHeight() as follow seems to resolve the issue :
if (scrollParent) {
const scrollRect = scrollParent.getBoundingClientRect();
const scrollTop = scrollRect.y || scrollRect.top;
const scrollBottom = scrollRect.bottom || scrollTop + scrollRect.height;
top = Math.max(top, window.scrollY + scrollTop);
bottom = Math.min(bottom, window.scrollY + scrollBottom);
}
When an element to highlight is outside of the initial window (and needs to be scrolled to), the overlay covers this element.
It appears that the svg path of the overlay is calculated using
_getVisibleHeight(), which returns 0 in that case.This seems to be due to the fact that
_getVisibleHeight()usesscrollParent.getBoundingClientRect(), without takingwindow.scrollYinto account. The modification of_getVisibleHeight()as follow seems to resolve the issue :