Skip to content

DataGrid height doesn't update when rowCount does #5030

Closed
elastic/kibana
#114718

Description

@machadoum

I am having issues with DataGrid and vertical scroll. Ideally, I would like my grid never to scroll vertically. Instead, it should expand to the full height based on its content. And I am not using data grid pagination.

When I change rowCount dynamically, the height doesn't get re-calculated.

Screenshot 2021-08-13 at 18 14 49

I was able to isolate the issue on codesandbox

There is a second bug related to calculated height present in this sandbox that might be related. The computed height is too small when the grid has a horizontal scroll.
Screenshot 2021-08-16 at 10 28 26

Activity

  1. changed the title [-]DataGrid height doesn't update when number of item does[/-] [+]DataGrid height doesn't update when number of items does[/+] on Aug 16, 2021
  2. changed the title [-]DataGrid height doesn't update when number of items does[/-] [+]DataGrid height doesn't update when `rowCount` does[/+] on Aug 16, 2021
  3. elizabetdev commented on Aug 18, 2021

    @elizabetdev
    Contributor

    There is a second bug related to calculated height present in this sandbox that might be related. The computed height is too small when the grid has a horizontal scroll.

    Just mentioning that this issue is very similar to this one: #4163. But in this case, the data grid is not taking into account the horizontal scrollbar when calculating the height.

  4. machadoum commented on Aug 18, 2021

    @machadoum
    MemberAuthor

    I was investigating it and looks like there are 2 different problems. The data grid is not taking into account the horizontal scrollbar when calculating the height and also data grid not recalculating its height when rowCount changes.

  5. machadoum commented on Aug 24, 2021

    @machadoum
    MemberAuthor

    As a workaround, I added the DataGrid pagination property. It fixed one issue for me, now it does recalculate the height when pageSize changes. But the other issue is still happening.

    The computed height is too small when the grid has a horizontal scroll.

  6. added a commit that references this issue on Aug 26, 2021
  7. reopened this on Oct 19, 2021
  8. cchaos commented on Oct 19, 2021

    @cchaos
    Contributor

    I don't think this is fixed. The Security solution's "hack" is very pixel based which won't work long-term as we continue to build user-controlled layout options.

  9. cee-chen commented on Jan 24, 2022

    @cee-chen
    Contributor

    This should have been resolved by #5313 and #5400

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions