Skip to content

Commit

Permalink
Imporvement for scroll-bounce issue
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaraJay committed Feb 7, 2024
1 parent e7bf57c commit 3a82b0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/renderer/pages/Pile/Posts/VirtualList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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 }}
/>
</AnimatePresence>
Expand Down

0 comments on commit 3a82b0d

Please sign in to comment.