virtual icon indicating copy to clipboard operation
virtual copied to clipboard

Uncaught Error: Maximum update depth exceeded. When we add styles for first row.

Open barugass opened this issue 2 years ago • 0 comments

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

  1. Add styles for the first row( tr:first-child { padding: 8px; or border: 1px solid lightgray; } )
  2. Start scrolling the table.
  3. An error has occurred.

Expected behavior

The application did not crash.

How often does this bug happen?

Every time

Screenshots or Videos

Снимок экрана 2024-02-22 в 11 33 20 AM

Platform

OS: macOS Browser: Chrome

tanstack-virtual version

v3.1.2

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct

  • [X] I agree to follow this project's Code of Conduct
  • [X] 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.

barugass avatar Feb 22 '24 09:02 barugass