Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#239 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@piotrkulpinski arbeitet bereits daran.

Seit 21.10.2026.

  • #240 von @piotrkulpinski — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Veraltet
Tech-Stack
react, typescript

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
850
Forks
56
Ø Merge
3 Std. 59 Min.
Gemergte PRs (30 T.)
19

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/charts

Alle Issues in TanStack/charts

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.