fix: adjust tooltip z-index to fix hidden node labels in Explore search/pathfinding - BED-9077 - #3062
fix: adjust tooltip z-index to fix hidden node labels in Explore search/pathfinding - BED-9077#3062julian1j wants to merge 1 commit into
Conversation
TooltipContent used z-50, which sits below the app's overlay layers — the Explore search combobox dropdown alone uses z-index 1300. Hovering a node kind icon in search or pathfinding rendered the label underneath the results list instead of over it. Use z-[1500], matching the other portaled floating content in doodle-ui (Select content, DatePicker popover, Dialog content).
📝 WalkthroughWalkthroughThe tooltip content z-index utility changes from ChangesTooltip stacking order
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
It may be preferable to ensure the parent container has a separate stacking context instead of changing the z index of the tooltip at the component library level |
I think Tooltips are rendered in a React portal, which takes them out of the component stack? I had a similar issue to the one shared here, where tooltips that were defined around components in a Menu were showing behind the menu because of that.. I could definitely be wrong on that assumption, but that's at least how MUI's tooltips work (I imagine Radix – our underlying tooltip provider – does something similar) |
That sounds like a good assumption. I suppose as long as our design system/component library is not prescriptive about z-indicies then this change is fine. The other solution that occurs to me would be to isolate the react root element into a separate stacking context wholesale via https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/isolation I bring it up because I'm not confident that this change to the component library won't trigger visual regressions in other areas of the app. But we can squash them if we find them. |
Hovering over a node kind icon in search or pathfinding rendered the label underneath the results list instead of over it. This is because TooltipContent used z-50, which sits below the app's overlay layers. the Explore search dropdown alone uses z-index 1300.
Proposed fix changes this to z-[1500], matching the other floating content in doodle-ui (Select content, DatePicker popover, Dialog content).
Description
Single file, one line modification, change z-50 to z-[1500]
Motivation and Context
Resolves BED-9077
Why is this change required? What problem does it solve?
How Has This Been Tested?
Tested locally in CE. Search for a node in Explore, hover over the node icon, you should see a tooltip/label for the node type.
Screenshots (optional):
Before:

After:

Types of changes
Checklist:
Summary by CodeRabbit