Skip to content

[EuiDataGrid] Row height options props update doesn't work #5524

Closed

Description

@dimaanj

Summary

Updating rowHeightOptions prop doesn't lead change of display option (single / auto height / custom), but DataGrid itself updates height correctly.

Activity

  1. chandlerprall commented on Jan 10, 2022

    @chandlerprall
    Contributor

    Reproduced in a code sandbox: https://codesandbox.io/s/elegant-euclid-27puv?file=/demo.js

    Selecting a new default height does not change which height the grid says is its deafult, and once a user selects a height from the grid's popover, the application's setting has no effect.

  2. self-assigned this
    on Jan 10, 2022
  3. cee-chen commented on Jan 10, 2022

    @cee-chen
    Contributor

    Will take a look into fixing this shortly!

    As a heads up, I also chatted with @kertal when he pinged me about this issue and I just wanted to raise another possible edge case related to consumers/developers updating the rowHeightsOptions prop & not receiving an expected display selector update.

    The fix for this will address the following scenario:

    1. The data grid initializes with an undefined default row height
    2. The user has not yet interacted with the row height switcher in any way
    3. The consumer/developer sets row height to auto via props
    4. Outcome: The datagrid should show an updated row height of auto in the display selector

    The fix for this will not address the following scenario:

    1. The data grid initializes with an undefined default row height
    2. The user sets row height to a line count of 2 in the UI controls
    3. The consumer/developer sets row height to auto via props
    4. Outcome: Step 3 is ignored, and the datagrid will still show a row height of line count. User settings will always override consumer settings (note that this is also how the density control behaves and has previously behaved)

    @kertal described this latter behavior as not what their app wants, which would need discussion from UX/our team IMO, because it's a deviation from the current intentional UX. I also suggested a possible workaround of completely remounting the data grid (which would clear user settings), since he also incidentally described their desired behavior as being tied to page/URL state.

  4. cchaos commented on Jan 10, 2022

    @cchaos
    Contributor

    What triggered no. 3 in that second scenario?

    1. The consumer/developer sets row height to auto via props

    Seems to me if the user initiated this reset to "auto" through some other piece of the UI, then it is ok to re-render the grid with this new setting.

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