react-data-grid icon indicating copy to clipboard operation
react-data-grid copied to clipboard

Columns not always resizing correctly on window resize

Open armiiis opened this issue 2 years ago • 2 comments

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-grid version: 7.0.0-beta.31
  • react/react-dom version: 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?

armiiis avatar Jun 01 '23 04:06 armiiis

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:

  1. Open dev tool and resize it to hide half width of the grid

image 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: image

andriy-viyatyk avatar Aug 03 '23 07:08 andriy-viyatyk

Finally I have fixed this issue applying patch using library (https://github.com/ds300/patch-package):

image

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

andriy-viyatyk avatar Aug 11 '23 19:08 andriy-viyatyk