react-data-grid
react-data-grid copied to clipboard
Columns not always resizing correctly on window resize
Describe the bug
Sometimes columns are not resizing correctly when window is resized.
https://github.com/adazzle/react-data-grid/assets/12126557/a64d86c1-f254-4905-8045-c889eeb216ab
To Reproduce
See video
Expected behavior
Columns resizing correctly.
Environment
react-data-gridversion:7.0.0-beta.31react/react-domversion:18.2.0
Additional context
It's easier to reproduce with developer tools opened. Its harder to reproduce with regular window resize, but also possible. Is there any workaround to manually force columns to resize?
I have the same issue on react-data-grid version 7.0.0.-beta.34 It is reproducible on demo page: https://adazzle.github.io/react-data-grid/#/cell-navigation Steps:
- Open dev tool and resize it to hide half width of the grid
2. Press "F12" to close dev tool. Press "F12" to open dev tool
Expected: all columns should be visible with recalculated widths
Actual: columns widths not changed and right columns not visible:
Finally I have fixed this issue applying patch using library (https://github.com/ds300/patch-package):
this patch implements new DataGrid property "disableColumnVirtualization". In case when we need "auto" columns to fit the grid width we really do not need "column virtualization" It will be grate to have in new version separate properties for row and column virtualization