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

未關閉
#676 0 則留言 3 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
typescript

研究方向

執行連結的 StackBlitz 重現,並檢查 src/index.css,從會變更列高的第一列樣式開始。追蹤樣式變更後的虛擬化測量與捲動行為;當表格能夠繼續捲動,且不會進入無限更新迴圈或當機時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

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
  • 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.
主要語言
TypeScript
星號
7.2k
分支
495
平均合併
23 小時 16 分鐘
30 天內合併 PR
19

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/virtual 的其他 Issue

查看 TanStack/virtual 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。