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

remove z-index on ActionBar #11502

Merged

Conversation

kendallgassner
Copy link

A z-index was added to the action bar component in the following pr (#6759)

It looks like they added the z-index to make it work for the panel component but after removing the z-index and testing on storybook it looks like the z-index is not needed.
Screen Shot 2020-07-10 at 12 02 30 PM

In my own code base I am using the doc's preview component to add my story examples in my documentation. When I am using the preview component to render a modal the actions bar appears above my modal. (due to the z-index)

Screen Shot 2020-07-10 at 11 15 43 AM

^ you can see it appears above my background as well as on my modal.

Because the z-index is not necessary and will be a problem when working with popups I am proposing to remove it.

@shilman
Copy link
Member

shilman commented Jul 11, 2020

@ndelangen @domyen can one of you take a look

@ndelangen
Copy link
Member

I can't guarantee this won't be added back in the future if it turns out it's required for storybook to work properly..

We can remove it now, since it's not needed, thanks for checking & the PR! 👏

Just a bit of advice (do with it as you wish):
Modals should probably be using some sort of "React Portal" to ensure they escape the z-index of their trigger-parent..

@ndelangen ndelangen merged commit 4e8013d into storybookjs:next Jul 15, 2020
@ndelangen ndelangen added this to the 6.0 milestone Jul 15, 2020
@kendallgassner
Copy link
Author

kendallgassner commented Jul 15, 2020

@ndelangen I dont think react-portal does anything to escape z-indexes? I believe it just attaches the portal div to the end of the body.
(react-portal)

@ndelangen
Copy link
Member

@kendallgassner the fact you're rendering in the body means you're escaping all rendering stacks of the parent elements.

@domyen
Copy link
Member

domyen commented Jul 24, 2020

I found a bug in the Actions addon where I can't click on the ActionBar without the z-index. This is probably why we added the z-index in the first place.

Video here

@ndelangen can we revert this?

@ndelangen
Copy link
Member

PR open @domyen

@RichardVoyles09
Copy link

This is awesome

shilman added a commit that referenced this pull request Jul 29, 2020
Revert #11502: Remove z-index on ActionBar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants