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

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

Closed
dimaanj opened this issue Jan 10, 2022 · 3 comments · Fixed by #5526
Closed

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

dimaanj opened this issue Jan 10, 2022 · 3 comments · Fixed by #5526
Assignees

Comments

@dimaanj
Copy link
Contributor

dimaanj commented Jan 10, 2022

Summary

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

@chandlerprall
Copy link
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.

@cee-chen
Copy link
Contributor

cee-chen commented Jan 10, 2022

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.

@cchaos
Copy link
Contributor

cchaos commented Jan 10, 2022

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
Projects
None yet
5 participants