Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential bug: infinite scroll could cause tab crash #8

Open
SgtPooki opened this issue Dec 5, 2024 · 0 comments
Open

potential bug: infinite scroll could cause tab crash #8

SgtPooki opened this issue Dec 5, 2024 · 0 comments

Comments

@SgtPooki
Copy link

SgtPooki commented Dec 5, 2024

i'm no vue expert but I think the source is here?

<template>
<div id="results">
<ul v-if="booksList.length">
<BookCard
v-for="(result, index) in booksList"
:key="index"
:book="result"
@click="onBookClick(result)"
/>
</ul>
<p v-if="isLoading">Searching {{ remote }}...</p>
<p v-if="!isLoading && !booksList.length">No results</p>
</div>
</template>

basically, when scrolling down, it looks like the BookCard's are all being added to the dom, and never removed. Also, there is no pre-fetching of next bookcards, so scrolling is blocked for a bit while scrolling.

ideally, a few scrolls ahead (up and down) would be fetched so scrolling always has content to render.

Also, when BookCards are no longer in view, they could be removed from the DOM to prevent large lists from overwhelming a tab.

If you are using Helia and a persistent blockstore, fetching data for books (to render the BookCard) based on scroll position should be almost instant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant