Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom tooltip component does not take zIndex prop from chart theme #2490

Closed
zhikin2207 opened this issue Dec 14, 2023 · 5 comments
Closed

Comments

@zhikin2207
Copy link

zhikin2207 commented Dec 14, 2023

Hi,

I've tried to change a zIndex of a custom tooltip and faced with the problem. Every tooltip is wrapped with one more component that has zIndex: 10, and it is not possible to change it from the chart theme.

codesandbox

image

I am not sure the issue in this part of the code, but it is very likely. Because when I pass { tooltip: { zIndex: 10000 } } to the theme, everything works fine (except compile errors).

Has someone faced with this issue?

@zhikin2207
Copy link
Author

zhikin2207 commented Jan 27, 2024

Temporary fix:

// @ts-ignore
theme={{ tooltip: { zIndex: 10000 } }}

@plouc
Copy link
Owner

plouc commented Mar 7, 2024

It's a typing issue, theme.tooltip type (defined in @nivo/core, CompleteTheme) doesn't allow this, but the code does.

@gtibrett
Copy link
Contributor

gtibrett commented Mar 27, 2024

packages/tooltip/src/TooltipWrapper.tsx line 81 has the actual bug, if not just related.

Maybe ...theme.tooltip should be ...theme.tooltip.wrapper and theme updated to specifically allow this kind of extension?

gtibrett added a commit to gtibrett/nivo that referenced this issue Mar 27, 2024
extend tooltip theme to allow customization of TooltipWrapper component
gtibrett added a commit to gtibrett/nivo that referenced this issue Mar 27, 2024
extend tooltip theme to allow customization of TooltipWrapper component
plouc pushed a commit that referenced this issue Apr 23, 2024
* Issue #2490
extend tooltip theme to allow customization of TooltipWrapper component

* Issue #2490
extend tooltip theme to allow customization of TooltipWrapper component
@plouc
Copy link
Owner

plouc commented Apr 23, 2024

Solved by #2552, it can now be customized via tooltip.wrapper.

@plouc plouc closed this as completed Apr 23, 2024
@plouc
Copy link
Owner

plouc commented Apr 29, 2024

It's been released in 0.86.0.

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

No branches or pull requests

3 participants