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

Pass EuiSuperSelect's popoverClassName to the popover's panel #2068

Merged
merged 3 commits into from
Jun 20, 2019
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 @@ -8,6 +8,7 @@
- Changed `popout` glyph in `EuiIcon` to look more like external link ([2064](https://github.com/elastic/eui/pull/2064))
- Tweaked `SuperDatePicker` to make the start/end date selection more obvious ([#2049](https://github.com/elastic/eui/pull/2049))
- Added `toSentenceCase` string service ([#2049](https://github.com/elastic/eui/pull/2049))
- Pass `EuiSuperSelect`'s `popoverClassName` to the popover's panel ([#2068](https://github.com/elastic/eui/pull/2068))

**Bug fixes**

Expand Down
6 changes: 5 additions & 1 deletion src/components/form/super_select/super_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,10 @@ export class EuiSuperSelect extends Component {
popoverClassName
);

const popoverPanelClasses = classNames('euiSuperSelect__popoverPanel', {
[`${popoverClassName}__popoverPanel`]: !!popoverClassName,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the brackets necessary? Shouldn't it just be:

Suggested change
[`${popoverClassName}__popoverPanel`]: !!popoverClassName,
`${popoverClassName}__popoverPanel`: !!popoverClassName,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh, I guess this is the first time we've used this pattern. 👍

});

const buttonClasses = classNames(
{
'euiSuperSelect--isOpen__button': this.state.isPopoverOpen,
Expand Down Expand Up @@ -232,7 +236,7 @@ export class EuiSuperSelect extends Component {
<EuiPopover
className={popoverClasses}
anchorClassName="euiSuperSelect__popoverAnchor"
panelClassName="euiSuperSelect__popoverPanel"
panelClassName={popoverPanelClasses}
button={button}
isOpen={isOpen || this.state.isPopoverOpen}
closePopover={this.closePopover}
Expand Down