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

オープン
#676 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript

調査の方向性

リンクされた StackBlitz の再現を実行し、src/index.css を調べます。まず、行の高さを変更する 1 行目のスタイルから確認してください。スタイルの変更後に続く仮想化の測定とスクロールの動作を追跡します。テーブルが無限の更新ループやクラッシュなしにスクロールし続ければ完了です。

索引モデルが 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分
マージ済み PR(30日)
19

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

TanStack/virtual のほかの issue

TanStack/virtual の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。