fix prefill and scrolling to populate the infinite scroll even when the infinite element is smaller than the document