Skip to content

[EuiFlexGroup] Responsive flex layouts do not work with buttons properly #4139

@efreeti

Description

@efreeti

The following markup is creating broken layout when switching to small screen mode (responsive support):

    <EuiFlexGroup direction="row">
      <EuiFlexItem>
        <EuiFlexGroup direction="column">
          <EuiFlexItem>text</EuiFlexItem>
          <EuiFlexItem>
            <EuiButton>text</EuiButton>
          </EuiFlexItem>
        </EuiFlexGroup>
      </EuiFlexItem>
    </EuiFlexGroup>

Here's how it looks like:

broken

The fix seems to be the following:

    <EuiFlexGroup direction="row">
      <EuiFlexItem>
        <EuiFlexGroup direction="column">
          <EuiFlexItem>text</EuiFlexItem>
          <EuiFlexItem>
            <EuiButton contentProps={{ style: { height: 'auto' } }}>text</EuiButton>
          </EuiFlexItem>
        </EuiFlexGroup>
      </EuiFlexItem>
    </EuiFlexGroup>

Here's how it looks (also expected look for the first code sample):

fixed

Metadata

Metadata

Assignees

Labels

documentationIssues or PRs that only affect documentation - will not need changelog entries

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions