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 leaves unnecessary margin on right side when used in FlexGroup #2225

Closed
shahzad31 opened this issue Aug 14, 2019 · 7 comments · Fixed by #2236
Closed

EuiSuperDatePicker leaves unnecessary margin on right side when used in FlexGroup #2225

shahzad31 opened this issue Aug 14, 2019 · 7 comments · Fixed by #2236

Comments

@shahzad31
Copy link
Contributor

In UpTime we are using EuiSuperDatePicker in header bar, when used like this

                    <EuiFlexGroup
                      alignItems="center"
                      justifyContent="spaceBetween"
                      gutterSize="s"
                    >
                      <EuiFlexItem grow={false}>
                        <EuiTitle>
                          <h1>{headingText}</h1>
                        </EuiTitle>
                      </EuiFlexItem>
                      <EuiFlexItem grow={false}>
                        <UptimeDatePicker refreshApp={refreshApp} {...rootRouteProps} />
                      </EuiFlexItem>
                    </EuiFlexGroup>

EuiSuperDatePicker itself is a flex group with guttersize "s" so it leaves margin at end as shown below
image

I think this can be resolved by providing option to override the guttersize in component or by customizing it's css.

This issue was discovered in UpTime app #40585

@cchaos
Copy link
Contributor

cchaos commented Aug 14, 2019

@shahzad31 The gutterSize is necessary to put a space between the date picker and the refresh button. Looking at your code I see you're only indicating down to the wrapper you have around the date picker <UptimeDatePicker>. Can you also detail what that component returns?

@shahzad31
Copy link
Contributor Author

shahzad31 commented Aug 14, 2019

@cchaos here is the wrapper

  return (
    <EuiSuperDatePicker
      start={dateRangeStart}
      end={dateRangeEnd}
      commonlyUsedRanges={CLIENT_DEFAULTS.COMMONLY_USED_DATE_RANGES}
      isPaused={autorefreshIsPaused}
      refreshInterval={autorefreshInterval}
       ....
   />
  );

@cchaos
Copy link
Contributor

cchaos commented Aug 14, 2019

So it's actually more of a combination of the negative margins produced by the EuiFlexGroup and the max-width: 100% applied to the .euiSuperDatePicker__flexWrapper

This will take some time to figure out. I tried to find a workaround for now, but there wasn't anything obvious that wouldn't then get quite messed up once this actually fixed.

@shahzad31
Copy link
Contributor Author

@cchaos since it has fixed gutter small, why not use max-width: calc(100% + 8px); ? i think that will solve the problem.

@cchaos
Copy link
Contributor

cchaos commented Aug 14, 2019

That's what I'm thinking too, but we'd have to check all the current usages to ensure the solution works no matter where it's placed.

@shahzad31
Copy link
Contributor Author

Going to reopen this for mobile responsiveness, we missed that use case. See the margin on the right side of refresh button, going to fix that
image

@shahzad31 shahzad31 reopened this Sep 25, 2019
@shahzad31
Copy link
Contributor Author

Closing this, since new issue should be open for missed use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants