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

Lower z-index on "Show code" button #14074

Closed
wants to merge 2 commits into from
Closed

Conversation

kylemh
Copy link
Member

@kylemh kylemh commented Feb 26, 2021

Issue:

What I did

Removed set z-index from the div that wraps the "Show code" button in a story preview block. I don't wanna get into a fight with z-indeces anywhere - least of all within Storybook. My modals are rendered via portals which should be last in the DOM beating any z indeces; however, in Storybook, those portals are rendered within the preview block's iFrame, meaning they aren't rendered last.

Before

Screen Shot 2021-02-26 at 12 55 44 PM

After

Screen Shot 2021-02-26 at 12 55 32 PM

┆Issue is synchronized with this Asana task by Unito

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like zIndex was added for this:

#11502 (comment)

Can you investigate?

@kylemh
Copy link
Member Author

kylemh commented Feb 27, 2021

@domyen that video is 404ing from Loom. Do you remember the problem?

Ah never mind, I see #11686

@kylemh
Copy link
Member Author

kylemh commented Feb 27, 2021

@ndelangen so I am using portals, but they render at the bottom of the body within the iFrame, meaning the "Show code" button appears after it in the page's DOM, so that's not a solution.

@MichaelArestad MichaelArestad self-assigned this Jul 6, 2021
@MichaelArestad MichaelArestad added this to the Design milestone Jul 6, 2021
@MichaelArestad
Copy link
Contributor

Right. I did a few tests and I can confirm that the actions can't be used in some scenarios without the add z-index: 1. It looks like there is a div with the classos-padding that has a z-index: 1 which makes those actions inaccessible when their z-index is removed.

I tried changing the os-padding z-index to 0 and that seemed to work, but may break something else. I'm not familiar with what is adding those styles, but I think it has something to do with scrollbars. @kylemh perhaps investigating that route further could prove fruitful?

@kylemh kylemh changed the title dont set z-index on "Show code" button Lower z-index on "Show code" button Jul 8, 2021
@kylemh
Copy link
Member Author

kylemh commented Jul 8, 2021

@MichaelArestad zIndex 0 solved my issue. Committed here so you can see the result in terms of Storybook (rather than just my Storybook usage).

@MichaelArestad
Copy link
Contributor

@kylemh Right. I tried that yesterday. You can see on the Docs/DocsPage story in the published storybook that the "Code" button is no longer clickable.

@shilman shilman modified the milestones: Design, 6.4 PRs Jul 22, 2021
@MichaelArestad MichaelArestad removed their assignment Jul 26, 2021
@MichaelArestad MichaelArestad removed this from the 6.4 PRs milestone Jul 26, 2021
@MichaelArestad
Copy link
Contributor

Because this is breaking functionality and seems to be inactive, I'm going to close this PR. If you would like to try another iteration, I would be happy to reopen it. Thank you for contributing.

@kylemh kylemh deleted the change-show-code-button branch August 17, 2021 00:11
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.

3 participants