Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

React custom tooltip body shows the previous point for a frame after a pointer move

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

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

@piotrkulpinski がすでに取り組んでいます。

2026年10月21日 から。

  • #240 @piotrkulpinski による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
react, typescript

調査の方向性

Start with charts-core/src/tooltip.ts and the React adapter’s TooltipBody, then trace bodyChange from paint() and the adapter’s update/destroy paths. The issue proposes using flushSync for interaction updates while keeping plain state updates during lifecycle work. Done means pointer moves show the current tooltip body without a one-frame flicker and keyboard moves still work; pull request #240 is already open.

索引モデルが issue の本文から書いたものです。

説明

What happens

With a custom React tooltip body (renderTooltipBody from @tanstack/react-charts/tooltip), moving the pointer to another point shows the previous point's body at the new point's position for one frame. The tooltip then updates. It reads as a flicker on every hover move.

Why

paint() in charts-core/src/tooltip.ts positions the tooltip element and calls bodyChange in the same task. The React adapter's TooltipBody answers with a plain setTarget(). React schedules a state update from a native pointermove listener at continuous priority, which renders in a later task. The browser paints in between, so the frame shows the moved element with the old body.

A keyboard move doesn't show it: React flushes a discrete-event update in a microtask, before the paint.

Reproduce

Any RendererChart with focus: "group-x" and a renderTooltipBody. Move the pointer slowly across the points, or record the screen and step through the frames.

Seen on @tanstack/charts 1.0.0 (/react/tooltip) and still present on main (a2e82ab).

Possible fix

Flush the body update with flushSync when the call comes from an interaction. Keep the plain setState when the adapter repaints inside React's layout effect (adapter.update/destroy), where flushSync warns ("flushSync was called from inside a lifecycle method"). I'll open a PR with that.

主要言語
TypeScript
スター
842
フォーク
53
平均マージ
3時間 59分
マージ済み PR(30日)
19

環境構築

はじめの一歩

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

TanStack/charts のほかの issue

TanStack/charts の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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