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

[EuiSuperDatePicker] Fix incorrect button margins in quick select popover #6380

Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
// sass-lint:disable-block function-name-format

.euiSuperDatePicker__flexWrapper {
// Need to offset 8px because of negative margins added by small size gutter
max-width: calc(100% + #{$euiSizeS});
Comment on lines -4 to -5
Copy link
Contributor

@cee-chen cee-chen Nov 17, 2022

Choose a reason for hiding this comment

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

Just for context - I spotted this issue in Kibana vs. EUI's docs - not 100% sure what the difference is in our implementation, but here's the before and after:

Before

After

Copy link
Contributor Author

@elizabetdev elizabetdev Nov 17, 2022

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.

Gotcha, thanks!! This fix doesn't seem to affect our EUI docs either way so I think is fairly safe to do

max-width: 100%;
// Set a sensible min-width for when width is auto
min-width: MIN(($euiFormMaxWidth / 2) + $euiSuperDatePickerButtonWidth + $euiSizeS, 100%);
width: $euiSuperDatePickerWidth + $euiSuperDatePickerButtonWidth + $euiSizeS;

@include euiBreakpoint('xs', 's') {
width: 100%;
}

&.euiSuperDatePicker__flexWrapper--fullWidth {
// Need to offset 8px because of negative margins added by small size gutter
width: calc(100% + #{$euiSizeS});
width: 100%;
}

&.euiSuperDatePicker__flexWrapper--isQuickSelectOnly {
Expand Down Expand Up @@ -76,9 +78,3 @@
cursor: not-allowed;
}
}

@include euiBreakpoint('xs', 's') {
.euiSuperDatePicker__flexWrapper {
width: calc(100% + #{$euiSizeS});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@
.euiQuickSelectPopover__sectionItem {
font-size: $euiFontSizeS;
line-height: $euiFontSizeS;

&:not(:last-of-type) {
margin-bottom: $euiSizeS;
}
Copy link
Contributor

@cee-chen cee-chen Nov 17, 2022

Choose a reason for hiding this comment

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

@miukimiu this fix for the commonly used section unfortunately creates a visual bug in the recently used section:

I'm pushing up a fix now to add a modifier class for recently used items

edit: 293ea9f

}
3 changes: 3 additions & 0 deletions upcoming_changelogs/6380.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed incorrect margins in `EuiSuperDatePicker` caused by `EuiFlex` CSS gap change