TanStack / TanStack/table

Infinite loop caused by combining virtual scroll and grouping

Open
#4,929 5 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28.4k
Forks
3.6k
Avg merge
1d 14h
Merged PRs (30d)
10

Description

Describe the bug

I'm trying to combine virtual scrolling and row grouping, but it is causing an infinite loop.

Here is an example. Uncomment line 75 in main.tsx and you will see endless console messages and the browser tab will freeze.

Is there another way I should be combining these two features, or is this a bug? I couldn't find an example online that combines these two features.

Your minimal, reproducible example

https://codesandbox.io/p/sandbox/elastic-mendeleev-3nqqhg?embed=1&file=%2Fsrc%2Fmain.tsx%3A75%2C32

Steps to reproduce
  1. Open https://codesandbox.io/p/sandbox/elastic-mendeleev-3nqqhg?embed=1&file=%2Fsrc%2Fmain.tsx%3A75%2C32
  2. Uncomment line 75
Expected behavior

Infinite loop does not occur

How often does this bug happen?

Every time

Screenshots or Videos

https://github.com/TanStack/table/assets/358661/865d1a1d-e995-4c94-a937-8419ca8b293e

Platform

Chrome, Arch Linux x64

react-table version

8.9.2

TypeScript version

No response

Additional context

react-virtual v2.10.4

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the linked CodeSandbox and inspect src/main.tsx around line 75, where combining virtual scrolling with row grouping triggers the loop. Reproduce the endless console messages with react-table 8.9.2 and react-virtual 2.10.4, then trace the interaction between those features. Done means the reproducible example no longer loops or freezes when grouping and virtual scrolling are enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.