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

EuiDatePicker popover does not handle screen edge in Firefox #2889

Closed
pickypg opened this issue Feb 21, 2020 · 0 comments · Fixed by #3359
Closed

EuiDatePicker popover does not handle screen edge in Firefox #2889

pickypg opened this issue Feb 21, 2020 · 0 comments · Fixed by #3359

Comments

@pickypg
Copy link
Member

pickypg commented Feb 21, 2020

I was attempting to use an EuiDatePickerRange within an EuiFlyout and I ran into this when using the end date in Firefox:

image

The major problem is ultimately caused by me setting the Flyout to maxWidth={0}. In Firefox, it its too narrow for the date picker and when it pops open, the horizontal scroll bar appears, but it does not move. If you click on the scroll bar to scroll to see it, then the popover disappears.

In Chrome / Chromium Edge, it appears to handle this by adding a horizontal scroll bar and automatically scrolling to the right.

Code Example
  render() {
    const now = moment();
    
    return (
      <EuiFlyout
        maxWidth={0}
        onClose={() => {}}
        ownFocus
        size='s'
      >
        <EuiFlyoutHeader hasBorder aria-labelledby='person-a'>
          <EuiTitle size='m'>
            <h2 id='person-a'>Person A</h2>
          </EuiTitle>
        </EuiFlyoutHeader>
        <EuiFlyoutBody>
          <EuiForm>
            <EuiFormRow
              label='Ranges'
            >
              <EuiDatePickerRange
                startDateControl={
                  <EuiDatePicker
                    aria-label="Start date"
                    minDate={now}
                    onChange={(startDate) => {}}
                    selected={now}
                  />
                }
                endDateControl={
                  <EuiDatePicker
                    aria-label="End date"
                    minDate={now}
                    onChange={(endDate) => {}}
                    selected={now}
                  />
                }
              />
            </EuiFormRow>
          </EuiForm>
        </EuiFlyoutBody>
        <EuiFlyoutFooter>
          <EuiFlexGroup justifyContent='spaceBetween'>
            <EuiFlexItem grow={false}>
              <EuiButtonEmpty
                flush='left'
                iconType='cross'
                onClick={() => {}}
              >
                Cancel
              </EuiButtonEmpty>
            </EuiFlexItem>
            <EuiFlexItem grow={false}>
              <EuiButton
                fill
                iconType='save'
                onClick={() => {}}
              >
                Save
              </EuiButton>
            </EuiFlexItem>
          </EuiFlexGroup>
        </EuiFlyoutFooter>
      </EuiFlyout>
    );
  }
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.

1 participant