Skip to content

[EuiDataGrid] Having a EuiFlexGroup in the trailingControlColumns causes the table to endlessly resize horizontally #4160

Closed

Description

@j-m

I did not want a row's actions to be in multiple columns or be hidden with a popover so I thought putting them in a FlexGroup was logical. Turns out, once the page loads, the table starts to infinitely resize horizontally, getting bigger and bigger...

I only used the FlexGroup to make the buttons inline, I'll look at using a button group next, but thought I should still report this.

  trailingControlColumns = [
    {
      id: 'actions',
      width: 40,
      headerCellRender: () => <EuiText>Actions</EuiText>,
      rowCellRender: () => {
        return (
          <EuiFlexGroup>
            <EuiFlexItem><EuiButtonIcon aria-label="Edit" onClick={() => this.edit} iconType="pencil" /></EuiFlexItem>
            <EuiFlexItem><EuiButtonIcon aria-label="Clone" onClick={() => this.clone} iconType="copy" /></EuiFlexItem>
            <EuiFlexItem><EuiButtonIcon aria-label="Delete" onClick={() => this.delete} iconType="trash" color="danger" /></EuiFlexItem>
          </EuiFlexGroup>
        )
      },
    },
  ]

Activity

  1. j-m commented on Oct 20, 2020

    @j-m
    ContributorAuthor

    Whoops, simply increasing the width makes them horizontal. Still, this is a strange bug

  2. chandlerprall commented on Oct 20, 2020

    @chandlerprall
    Contributor

    @sulemanof this sounds like what you ran into, what was your fix?

  3. snide commented on Oct 20, 2020

    @snide
    Contributor

    As with anything that inherits flex containers, wrapping it with a <div> normally solves the problem.

    I did not want a row's actions to be in multiple columns or be hidden with a popover

    It's extremely hard to maintain interoperability of components in large magical / high order components like data grid. The guidelines and default settings are there to provide some design decisions to maintain a stable default we know works. Within Elastic at least we also use them to maintain a level of consistentcy between our apps.

    I bring this up because it's not likely something we'd change and that limitation is by design.

  4. j-m commented on Oct 21, 2020

    @j-m
    ContributorAuthor

    Ah okay, makes sense, thank you for explaining the reasoning. As it's by design, I'll close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions