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

Multiple bug fixes for resizable container #3699

Merged

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jul 6, 2020

Fixes #3698

Summary

  • Fixed the bug reported in EuiResizableContainer having nested instances (vertical and horizontal) doesn't work #3698 where a nested panel would not resize. The issue came from looking at all resizable buttons in a container instead of only the ones directly used by a container
  • Fixed a bug where resizing by arrow keys did nothing in an un-controlled usage
  • Fixed a bug which impacted the last docs' example where resizable buttons of different sizes were improperly assumed to be of the same size

Replaced resizable_container_basic with the following for testing:

import React from 'react';
import { EuiText, EuiResizableContainer } from '../../../../src/components';
import { fake } from 'faker';

const text = (
  <>
    <p>{fake('{{lorem.paragraphs}}')}</p>
    <p>{fake('{{lorem.paragraphs}}')}</p>
    <p>{fake('{{lorem.paragraphs}}')}</p>
  </>
);

export default () => (
  <div>
    <EuiResizableContainer style={{ height: '600px' }}>
      {(EuiResizablePanel, EuiResizableButton) => (
        <>
          <EuiResizablePanel initialSize={60} minSize="20%">

            <EuiResizableContainer direction="vertical" style={{ height: '600px' }}>
              {(EuiResizablePanel, EuiResizableButton) => (
                <>
                  <EuiResizablePanel initialSize={50} minSize="20%">
                    <EuiText>
                      <p>Top Panel</p>
                    </EuiText>
                  </EuiResizablePanel>

                  <EuiResizableButton />

                  <EuiResizablePanel initialSize={50} minSize="10%">
                    <EuiText>
                      <p>Bottom Panel</p>
                    </EuiText>
                  </EuiResizablePanel>
                </>
              )}
            </EuiResizableContainer>

          </EuiResizablePanel>

          <EuiResizableButton />

          <EuiResizablePanel initialSize={40} minSize="10%">
            <EuiText>
              <p>{text}</p>
            </EuiText>
          </EuiResizablePanel>
        </>
      )}
    </EuiResizableContainer>
  </div>
);

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile

  • Checked in Safari and Firefox
    - [ ] Props have proper autodocs
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for the any docs examples
    - [ ] Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_3699/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

🙌
Tested locally with the provided example.
Tested keyboard nav across the board.

@chandlerprall chandlerprall merged commit 4c0eb12 into elastic:master Jul 7, 2020
@chandlerprall chandlerprall deleted the bug/3698-nested-resizable-panels branch July 7, 2020 15:17
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 this pull request may close these issues.

EuiResizableContainer having nested instances (vertical and horizontal) doesn't work
3 participants