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

Added additional/base amount of z-index to popovers #2341

Merged
merged 5 commits into from
Sep 17, 2019

Conversation

cchaos
Copy link
Contributor

@cchaos cchaos commented Sep 13, 2019

Fix EuiPopover base z-index

The z-index is based off of the parent and the triggering element. But if both are 0, then so is the popover which causes anything with a z-index of 1 or more to show on top.

Before

Screen Shot 2019-09-13 at 12 39 53 PM

I've added an example in the File Picker docs section that will show:

Before
Screen Shot 2019-09-13 at 14 10 37 PM

After
Screen Shot 2019-09-13 at 14 10 13 PM

I'll remove this before merge but allows for easy testing.

And popovers in flyouts still work

Screen Shot 2019-09-13 at 13 02 42 PM

Checklist

  • [ ] Checked in dark mode
  • [ ] Checked in mobile
  • [ ] Checked in IE11 and Firefox
  • [ ] Props have proper autodocs
  • [ ] Added documentation examples
  • Added or updated jest tests
  • [ ] Checked for breaking changes and labeled appropriately
  • [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@@ -458,7 +458,7 @@ export class EuiPopover extends Component<Props, State> {
const { zIndex: zIndexProp } = this.props;
const zIndex =
zIndexProp == null
? getElementZIndex(this.button, this.panel)
? getElementZIndex(this.button, this.panel) + 2000
Copy link
Contributor

Choose a reason for hiding this comment

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

Smart that you used 2000, which matches $euiZContentMenu. I might add a comment just for folks so they know that's why you picked that number.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want this to be plus 2000 or at least 2000 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was thinking plus then it's alway overtop of any other content with the container as well. But I can see that this could get complicated with flyouts and modals both appearing at the same time?

But it should be at least 2000, and would still need to add a significant amount if the container is at least 2000 already.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alright, let's stick with +2000 and see how it goes :)

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Changes LGTM, pulled locally and ran through the docs.

@cchaos cchaos merged commit acf20a9 into elastic:master Sep 17, 2019
@cchaos cchaos deleted the popover-zindex branch September 17, 2019 21:46
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

Successfully merging this pull request may close these issues.

3 participants