eui icon indicating copy to clipboard operation
eui copied to clipboard

[DataGrid] Grid style updates don't cause re-render

Open lukasolson opened this issue 1 year ago • 2 comments

Describe the bug CodeSandbox here: https://codesandbox.io/s/quirky-fire-cpj3v7?file=/demo.js

When the DataGrid accepts a gridStyle prop, updates to that prop don't cause the data grid to re-render.

In the above example, if you use the data grid controls to change the density, you'll see the grid re-render in response. However, if you click the button at the top "Reset to Compact", which explicitly sets the grid style to compact, it doesn't re-render (even though you can see the console logging the new grid style):

https://github.com/user-attachments/assets/75454b3d-0e04-46b6-b4dd-ea915bf545ce

Impact and severity This isn't currently a big issue, but it was found as part of https://github.com/elastic/kibana/pull/188495#discussion_r1712510252. We will have a workaround for that PR, but it would be nice if this could be fixed so the workaround can be removed.

lukasolson avatar Aug 13 '24 21:08 lukasolson

@lukasolson I'll try to fix it

pamellix avatar Aug 14 '24 10:08 pamellix

Thanks ya'll! We've added this to our backlog. We would be super happy to receive a PR for this -- otherwise we'll lump this into some larger Data Grid work we're planning for this quarter.

JasonStoltz avatar Aug 19 '24 17:08 JasonStoltz