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

Make EuiPopover copy the anchor's z-index to the popover content #967

Merged
merged 5 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fixed disabled states of icon buttons ([#963](https://github.com/elastic/eui/pull/963))
- Added word-break fallback for FF & IE in table cell ([#962](https://github.com/elastic/eui/pull/962))
- Fixed `EuiPopover` to show content over modals, flyouts, etc ([#967](https://github.com/elastic/eui/pull/967))

## [`1.0.1`](https://github.com/elastic/eui/tree/v1.0.1)

Expand Down
13 changes: 13 additions & 0 deletions src-docs/src/views/flyout/flyout_complicated.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiFlyoutBody,
EuiFlyoutFooter,
EuiFlyoutHeader,
EuiPopover,
EuiSpacer,
EuiTab,
EuiTabs,
Expand All @@ -27,6 +28,7 @@ export class FlyoutComplicated extends Component {
isFlyoutVisible: false,
isSwitchChecked: true,
selectedTabId: '1',
isPopoverOpen: false,
};

this.tabs = [{
Expand Down Expand Up @@ -55,6 +57,10 @@ export class FlyoutComplicated extends Component {
this.setState({ isFlyoutVisible: true });
}

togglePopover = () => {
this.setState(({ isPopoverOpen }) => ({ isPopoverOpen: !isPopoverOpen }));
}

onSelectedTabChanged = id => {
this.setState({
selectedTabId: id,
Expand Down Expand Up @@ -156,6 +162,13 @@ export class FlyoutComplicated extends Component {
<EuiSpacer size="s" />
<EuiText color="subdued">
<p>Put navigation items in the header, and cross tab actions in a footer.</p>
<EuiPopover
Copy link
Contributor

Choose a reason for hiding this comment

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

@chandlerprall Can you actually move this popover to the flyout body and outside of any EuiText elements.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, can you move it out of EuiFlyoutHeader and into <EuiFlyoutBody> below the EuiCodeBlock (line 181)? I want to be sure that when consumers copy-paste this, they're not overusing popovers in the headers.

closePopover={this.togglePopover}
button={<EuiButton onClick={this.togglePopover}>Even popovers can be included</EuiButton>}
isOpen={this.state.isPopoverOpen}
>
<p>This is the popover content, notice how it can overflow the flyout!</p>
</EuiPopover>
</EuiText>
<EuiTabs style={{ marginBottom: '-25px' }}>
{this.renderTabs()}
Expand Down
2 changes: 1 addition & 1 deletion src/components/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class EuiPopover extends Component {
});

// the popver's z-index must inherit from the button
// this keeps a button's popver under a flyover that would covert the button
// this keeps a button's popver under a flyover that would cover the button
// but a popover triggered inside a flyover will appear over that flyover
const zIndex = getElementZIndex(this.button, this.panel);

Expand Down