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

Configure z-index #57

Open
mattfelten opened this issue Apr 29, 2020 · 5 comments
Open

Configure z-index #57

mattfelten opened this issue Apr 29, 2020 · 5 comments

Comments

@mattfelten
Copy link

It looks like there's a default z-index of 99 to all instances of react-stick. I need to raise that to a higher z-index in my project. Is there any way to make this configurable?

@yakunins
Copy link
Contributor

yakunins commented Apr 30, 2020

@mattfelten There is a className availiable for Stick, so you may override z-index with it.

In react-stick v3.0.3 class has suffix __node:
image

In a previous react-stick v2.3.0 a className that been applied to Stick, was passed (with a suffix) into all the wrappers:

image

In both versions style prop applied to Stick seems to be ignored.

@frontendphil
Copy link
Contributor

Hey there. It seems like in order to get this to work (again?) you need to nest the styles.

style={{
  node: {
    zIndex: 1000
  }
}}

I'm looking into whether we should have mentioned that in the release notes.

@mattfelten
Copy link
Author

Including that in release notes, or even better, an example in the Readme of how to customize more of the internal components would be great. If I didn't look into the code and see it's using substyle, then subsequently looked up substyle to see what it was, the above format would look like magic to me.

@frontendphil
Copy link
Contributor

I didn't have time so far. But you're right. First off the way of styling shouldn't have changed. The major bump was only done because we required a react version that supports hooks now. The API should have stayed stable. But we might have missed the styling part since this has never been documented. I'll make a note to hopefully do that this week. That might also help some teams in our company :D

@frontendphil
Copy link
Contributor

In one of the latest versions, we started to export the PortalContext component. You can use this, for instance, in Modal components to anchor the stick nodes inside the modal instead of the body component. You can make this part of any modal component you might have so that Stick components inside it "just" display correctly and you don't have to fiddle around with z-index.

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

No branches or pull requests

3 participants