Uncaught Error: Maximum update depth exceeded. When we add styles for first row.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.1k
- Forks
- 466
- Avg merge
- 2d 31m
- Merged PRs (30d)
- 13
Description
Describe the bug
When virtualizing rows in @tanstack/table, if you add styles for the first row(:first-child) that change the height of the row and start scrolling, the calculation breaks down and the application crashes because it cannot calculate the height and goes into an infinity loop.
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-table-vduexv?file=src%2Findex.css
Steps to reproduce
- Add styles for the first row(
tr:first-child { padding: 8px; or border: 1px solid lightgray; }) - Start scrolling the table.
- An error has occurred.
Expected behavior
The application did not crash.
How often does this bug happen?
Every time
Screenshots or Videos
Platform
OS: macOS Browser: Chrome
tanstack-virtual version
v3.1.2
TypeScript version
No response
Additional context
No response
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Run the linked StackBlitz reproduction and inspect src/index.css, beginning with the first-row styles that change the row height. Trace the virtualization measurement and scrolling behavior that follows the style change; done means the table continues scrolling without an infinite update loop or crash.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100