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

Fix width of filter group items #1078

Merged
merged 5 commits into from
Aug 6, 2018
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 @@ -11,6 +11,7 @@
- Fixed large drop shadows so they work on darker backgrounds ([#1079](https://github.com/elastic/eui/pull/1079))
- Added `resize-observer-polyfill` as a dependency (was previously a devDependency) ([#1085](https://github.com/elastic/eui/pull/1085))
- Fixed `EuiBasicTable` to inform its parent about a selection change triggered by a different set of `items` ([#1086](https://github.com/elastic/eui/pull/1086))
- Fixed width of `EuiFilterGroup`'s popover ([#1078](https://github.com/elastic/eui/pull/1078))

## [`3.3.0`](https://github.com/elastic/eui/tree/v3.3.0)

Expand Down
1 change: 0 additions & 1 deletion src-docs/src/views/filter_group/filter_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export default class extends Component {
closePopover={this.closePopover.bind(this)}
panelPaddingSize="none"
withTitle
panelClassName="euiFilterGroup__popoverPanel"
>
<EuiPopoverTitle>
<EuiFieldSearch />
Expand Down
4 changes: 3 additions & 1 deletion src/components/filter_group/_filter_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
}
}

// A fixed width is required in IE11 because of the shift in widths that can be caused
// by the loading animation that precedes the results.
.euiFilterGroup__popoverPanel {
max-width: $euiSize * 20;
width: $euiSize * 18;
}
1 change: 1 addition & 0 deletions src/components/filter_group/_filter_select_item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@include euiFontSizeS;

padding: $euiSizeXS $euiSizeM;
display: block; // Necessary to make sure it doesn't force the whole popover to be too wide
width: 100%;
text-align: left;
color: $euiTextColor;
Expand Down
3 changes: 3 additions & 0 deletions src/components/flex/_flex_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
.euiFlexItem {
flex-grow: 1;
flex-basis: 0%; /* 2 */
@include internetExplorerOnly {
min-width: 1px;
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/components/flex/_flex_item.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
/**
* 1. Allow EuiPanels to expand to fill the item.
* 2. IE11 hack forces inner content of flex items to respect a higher parent's width (mostly) and
* not cause weird wrapping issues.
*/
.euiFlexItem {
display: flex; /* 1 */
flex-direction: column; /* 1 */

@include internetExplorerOnly {
min-width: 1px; /* 2 */
}

/*
* 1. We need the extra specificity here to override the FlexGroup > FlexItem styles.
Expand Down
10 changes: 10 additions & 0 deletions src/global_styling/mixins/_helpers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,13 @@
background-color: transparent;
}
}


/**
* Specifically target IE11, but not Edge.
*/
@mixin internetExplorerOnly {
@media screen and (-ms-high-contrast: active), screen and (-ms-high-contrast: none) {
@content;
}
}