Skip to content

Commit 9e2f4b4

Browse files
committed
fix: disable list scroll animation on first render
- do not animate list on initial render - use work-around because of react-virtuoso issue petyosi/react-virtuoso#1001 closes #2489 Signed-off-by: Maxim Stykow <maxim.stykow@tngtech.com>
1 parent 3032404 commit 9e2f4b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Frontend/Components/List/List.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ export function List({
7171
<Virtuoso
7272
ref={ref}
7373
fixedItemHeight={cardHeight}
74+
initialTopMostItemIndex={
75+
window?.process?.env.JEST_WORKER_ID // https://github.com/petyosi/react-virtuoso/issues/1001
76+
? undefined
77+
: {
78+
index: indexToScrollTo,
79+
behavior: 'auto',
80+
align: 'center',
81+
}
82+
}
7483
totalCount={length}
7584
isScrolling={setIsScrolling}
7685
style={{

0 commit comments

Comments
 (0)