-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
questionFurther information is requestedFurther information is requested
Description
This library is fantastic. Thank you for building this.
I thought I would write a suggestion to make it explicit the infiniteHandler working. I ran into an issue where I awaited for a promise inside the infiniteHandler and the scroll bar went into a scroll loop. It took hours of debugging to understand that we should not be awaiting inside the infiniteHandler and must return immediately. Hope will save some time for a future developer.
<script>
function infiniteHandler({ detail: { loaded, complete } }) {
// ---------------------------------------------------
// -- NOTE: There is no `await` for this promise --
// ---------------------------------------------------
fetch(`${api}&page=${page}`)
.then(response => response.json())
.then(data => {
...
});
}
</script>
<VirtualList height={400} itemSize={42} itemCount={list.length}>
...
<div slot="footer">
<InfiniteLoading on:infinite={infiniteHandler} />
</div>
</VirtualList>Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested