Skip to content

Commit

Permalink
fix: disable list scroll animation on first render
Browse files Browse the repository at this point in the history
- 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>
  • Loading branch information
mstykow committed Jan 11, 2024
1 parent a33317b commit 907f59f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Frontend/Components/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ export function List({
<Virtuoso
ref={ref}
fixedItemHeight={cardHeight}
initialTopMostItemIndex={
window?.process?.env.JEST_WORKER_ID // https://github.com/petyosi/react-virtuoso/issues/1001
? undefined
: {
index: indexToScrollTo,
behavior: 'auto',
align: 'center',
}
}
totalCount={length}
isScrolling={setIsScrolling}
style={{
Expand Down

0 comments on commit 907f59f

Please sign in to comment.