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

Tooltip is not changing z-index #1474

Open
samuelndm opened this issue May 26, 2022 · 5 comments
Open

Tooltip is not changing z-index #1474

samuelndm opened this issue May 26, 2022 · 5 comments

Comments

@samuelndm
Copy link

It has a inline style of z-index: 10 that is overlapping the z-index class

image

@samuelndm
Copy link
Author

I added this to the global css file and it worked

div[id*='evergreen-tooltip'] {
  z-index: 300 !important;
}

@brandongregoryscott
Copy link
Contributor

Hmmm, yeah - that's probably coming from the Positioner component we are using to calculate the Tooltip's position:

<Positioner target={renderTarget} isShown={shown} position={position} animationDuration={160}>
{({ css, getRef, state, style }) => (
<TooltipStateless
id={id}
appearance={appearance}
ref={getRef}
data-state={state}
style={style}

<Stack value={StackingOrder.POSITIONER}>

/**
* Used as the default for the Positioner.
*/
POSITIONER: 10,

I don't think this is really a use-case we've accounted for (overriding the default z-index for a Tooltip, or really any internal component that's leveraging the Positioner - it's supposed to be smart enough so that you don't need to manage your own z-index calculations.) What issue are you running into that requires such a drastic z-index shift?

@samuelndm
Copy link
Author

samuelndm commented May 31, 2022

@brandongregoryscott I'm sorry for not responding you soon.

The header and footer is overlapping the tooltip. The popover is having the same problem, there is a inline-style overriding the z-index.

@samuelndm
Copy link
Author

samuelndm commented May 31, 2022

This is how I'm trying to change the z-index

Popover
image

Tooltip
image

@brandongregoryscott
Copy link
Contributor

Hey @samuelndm, sorry for the delay here. The Tooltip leverages our Positioner utility component which has a static z-index set for a handful of components, and doesn't really read from the theme values. Being able to override this in the theme would require some internal restructuring to support. Going to mark this as low priority for now unless others feel very passionately about this feature.

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

2 participants