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

🐛 fix: Effectively interrupt auto scrolling #2223

Merged
merged 18 commits into from Apr 30, 2024
Expand Up @@ -38,7 +38,7 @@ const VirtualizedList = memo(() => {
if (virtuosoRef.current) {
virtuosoRef.current.scrollToIndex({ align: 'end', behavior: 'auto', index: 'LAST' });
}
}, [id]);
}, [id, data.length]);
arvinxx marked this conversation as resolved.
Show resolved Hide resolved

// overscan should be 1.5 times the height of the window
const overscan = typeof window !== 'undefined' ? window.innerHeight * 1.5 : 0;
Expand All @@ -50,11 +50,12 @@ const VirtualizedList = memo(() => {
atBottomThreshold={30}
computeItemKey={(_, item) => item}
data={data}
followOutput={'auto'}
// followOutput={'auto'}
sxjeru marked this conversation as resolved.
Show resolved Hide resolved
// increaseViewportBy={overscan}
initialTopMostItemIndex={data?.length - 1}
isScrolling={setIsScrolling}
itemContent={itemContent}
overscan={overscan}
overscan={{ main: overscan, reverse: overscan / 2 }}
arvinxx marked this conversation as resolved.
Show resolved Hide resolved
ref={virtuosoRef}
/>
<AutoScroll
Expand Down