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

Add zIndexAdjustment prop to EuiPopover #1097

Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -10,6 +10,7 @@
- Added `string` to allowed `restrictWidth` prop type of `EuiPage` and `EuiPageBody` ([#1090](https://github.com/elastic/eui/pull/1090))
- Added `.eui-textBreakNormal` and `@mixin euiTextTruncate` as CSS/SASS utilities ([#1092](https://github.com/elastic/eui/pull/1092))
- Added `fullWidth` support to `EuiComboBox` ([#1095](https://github.com/elastic/eui/pull/1095))
- Added `zIndexAdjustment` to `EuiPopover` which allows tweaking the popover content's `z-index` ([#1097](https://github.com/elastic/eui/pull/1097))

**Bug fixes**

Expand Down
7 changes: 6 additions & 1 deletion src/components/popover/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ export class EuiPopover extends Component {
// the popover's z-index must inherit from the button
// this keeps a button's popover under a flyout that would cover the button
// but a popover triggered inside a flyout will appear over that flyout
const zIndex = getElementZIndex(this.button, this.panel);
const { zIndex: zIndexProp } = this.props;
const zIndex = zIndexProp == null ? getElementZIndex(this.button, this.panel) : zIndexProp;

const popoverStyles = {
top,
Expand Down Expand Up @@ -307,6 +308,8 @@ export class EuiPopover extends Component {
panelClassName,
panelPaddingSize,
popoverRef,
repositionOnScroll, // eslint-disable-line no-unused-vars
zIndex, // eslint-disable-line no-unused-vars
...rest
} = this.props;

Expand Down Expand Up @@ -436,6 +439,8 @@ EuiPopover.propTypes = {
]),
/** When `true`, the popover's position is re-calculated when the user scrolls, this supports having fixed-position popover anchors. */
repositionOnScroll: PropTypes.bool,
/** By default, popover content inherits the z-index of the anchor component; pass zIndex to override */
zIndex: PropTypes.number,
};

EuiPopover.defaultProps = {
Expand Down