Skip to content

fix(tooltip): improve z-index calculations#2843

Draft
markov00 wants to merge 1 commit into
elastic:mainfrom
markov00:2026_05_22-fix_tooltip_z_index_calculation
Draft

fix(tooltip): improve z-index calculations#2843
markov00 wants to merge 1 commit into
elastic:mainfrom
markov00:2026_05_22-fix_tooltip_z_index_calculation

Conversation

@markov00
Copy link
Copy Markdown
Collaborator

@markov00 markov00 commented May 22, 2026

Summary

Fixes tooltip portal stacking when charts are rendered inside higher z-index containers, such as Kibana flyouts or sidebars.

The previous z-index lookup walked the offsetParent chain, which can skip DOM ancestors that still define the relevant body-level stacking order. In Kibana, this meant the chart inside kbnChromeLayoutSidebar could compute a z-index of 0 instead of the sidebar level, so the tooltip portal stayed behind the flyout chrome.

This change:

  • Walks DOM parents when computing the chart’s effective z-index, so ancestors like flyout/sidebar containers are considered.
  • Updates the z-index on an existing portal node when it is reused, instead of only setting it on initial creation.

Test Plan

  • Verified against a local Kibana flyout containing Elastic Charts.
  • Confirmed the old offsetParent lookup returned 0, while the DOM parent lookup finds the sidebar z-index (1050).
Screen.Recording.2026-05-22.at.17.21.18.mp4

Issues

fix #2838

Checklist

  • The proper chart type label has been added (e.g. :xy, :partition)
  • The proper feature labels have been added (e.g. :interactions, :axis)
  • All related issues have been linked (i.e. closes #123, fixes #123)
  • The code has been checked for cross-browser compatibility (Chrome, Firefox, Safari, Edge)

@markov00 markov00 added bug Something isn't working :tooltip Related to hover tooltip :all Applies to all chart types labels May 22, 2026
@elastic-datavis
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:all Applies to all chart types bug Something isn't working :tooltip Related to hover tooltip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tooltip portal z-index can render behind flyouts

1 participant