From 3a82b0db0c83bf52514f3298a67e3e12061f5c54 Mon Sep 17 00:00:00 2001 From: Udara Jay Date: Tue, 6 Feb 2024 20:51:16 -0500 Subject: [PATCH] Imporvement for scroll-bounce issue --- src/renderer/pages/Pile/Posts/VirtualList.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/pages/Pile/Posts/VirtualList.jsx b/src/renderer/pages/Pile/Posts/VirtualList.jsx index e07d370..e6d7c6c 100644 --- a/src/renderer/pages/Pile/Posts/VirtualList.jsx +++ b/src/renderer/pages/Pile/Posts/VirtualList.jsx @@ -29,7 +29,7 @@ const VirtualList = memo(({ data }) => { const handleRangeChanged = (range) => { const middle = Math.floor((range.startIndex + range.endIndex) / 2); - setVisibleIndex(middle); + setVisibleIndex(range.startIndex); }; const renderItem = useCallback((index, entry) => { @@ -66,8 +66,8 @@ const VirtualList = memo(({ data }) => { rangeChanged={handleRangeChanged} itemContent={renderItem} computeItemKey={getKey} - atTopThreshold={1300} - overscan={1500} + atTopThreshold={100} + increaseViewportBy={2000} components={{ Scroller: Scrollbar }} />