-
Notifications
You must be signed in to change notification settings - Fork 93
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
When the page scrolls to the bottom, the list data keeps loading infinitely #508
Comments
Change the state when last. const [items, setItems] = React.useState(() => getItems(0, 10));
const [last, setLast] = React.useState(false);
return (
<MasonryInfiniteGrid
className="container"
gap={5}
align={"justify"}
onRequestAppend={(e) => {
const nextGroupKey = (+e.groupKey! || 0) + 1;
if (last) {
return;
}
if (nextGroupKey >= 10) {
setLast(true);
}
setItems([...items, ...getItems(nextGroupKey, 10)]);
}}
onRenderComplete={(e) => {
console.log(e);
}}
>
...
</MasonryInfiniteGrid> |
@daybrush I'm getting the same issue with svelte. If I move the scrollbar to the bottom of the page - then there is an infinite load with the scroll staying fixed at the bottom whilst the loaded data is being added correctly and paged but the scroll bar does not bounce up to the footer of the previous group to allow me to scroll down and see the new data loaded. As the scrollbar appears fixed to the bottom showing loading message it keeps triggering the requestAppend which is correctly loading and paginating the data.
|
@JohnRSim @WilliamFocus
|
Description
When the page scrolls to the bottom, the list data keeps loading infinitely, So I hope the data should stop loading when MasonryInfiniteGrid is not visible in the page, how should handle this? thanks.
Steps to check or reproduce
https://codesandbox.io/s/black-glade-oednu3
The text was updated successfully, but these errors were encountered: