Skip to content

Comments

fix: Prevent page scroll when hovering chart tooltip#172

Merged
Who-is-PS merged 1 commit intomainfrom
dev-v3-philosr-tooltip-scroll
Feb 23, 2026
Merged

fix: Prevent page scroll when hovering chart tooltip#172
Who-is-PS merged 1 commit intomainfrom
dev-v3-philosr-tooltip-scroll

Conversation

@Who-is-PS
Copy link
Member

@Who-is-PS Who-is-PS commented Feb 23, 2026

Description

Hovering a chart with multiple series causes the entire page to scroll unexpectedly. This happens because scrollIntoViewNearestContainer in src/internal/utils/dom.ts falls back to document.documentElement when no scrollable parent is found, causing .scrollTo() to scroll the whole page.

The issue is triggered by series-details/index.tsx, which calls scrollIntoViewNearestContainer with scrollMode: "always" every time a tooltip appears with a highlighted series item. When the tooltip content area isn't inside a scrollable container, the fallback to documentElement scrolls the page instead.

Fix

Return early when getScrollParent() finds no scrollable ancestor, instead of falling back to document.documentElement. If there's no scrollable container, there's nothing to scroll into view.

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Who-is-PS Who-is-PS changed the title fix: Page scroll when tooltip opens fix: Prevent page scroll when hovering chart tooltip Feb 23, 2026
@Who-is-PS Who-is-PS marked this pull request as ready for review February 23, 2026 14:37
@Who-is-PS Who-is-PS requested a review from a team as a code owner February 23, 2026 14:37
@Who-is-PS Who-is-PS requested review from avinashbot and removed request for avinashbot February 23, 2026 14:37
@Who-is-PS Who-is-PS added this pull request to the merge queue Feb 23, 2026
Merged via the queue into main with commit 37e5a95 Feb 23, 2026
48 checks passed
@Who-is-PS Who-is-PS deleted the dev-v3-philosr-tooltip-scroll branch February 23, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants