Resize flex columns on (column) resize

There is a bug that after resizing, then scrolling, flex columns can snap back to their newly measured width (content-dependent). Maybe we need re-save measured widths after resizing. This won't re-flex columns when toggling columns for example, maybe this can be controlled in a parent state.
Codecov Report
Merging #3029 (7361da3) into main (44ac8c7) will increase coverage by
0.47%. The diff coverage is73.56%.
:exclamation: Current head 7361da3 differs from pull request most recent head dac0e41. Consider uploading reports for the commit dac0e41 to get more accurate results
@@ Coverage Diff @@
## main #3029 +/- ##
==========================================
+ Coverage 93.24% 93.71% +0.47%
==========================================
Files 40 41 +1
Lines 1303 1337 +34
Branches 405 411 +6
==========================================
+ Hits 1215 1253 +38
+ Misses 88 84 -4
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/hooks/useGridDimensions.ts | 81.81% <40.00%> (-18.19%) |
:arrow_down: |
| src/hooks/useColumnWidths.ts | 71.42% <71.42%> (ø) |
|
| src/DataGrid.tsx | 92.82% <100.00%> (+2.78%) |
:arrow_up: |
| src/HeaderCell.tsx | 90.00% <100.00%> (+17.14%) |
:arrow_up: |
| src/hooks/useCalculatedColumns.ts | 100.00% <100.00%> (ø) |
|
| src/hooks/useViewportColumns.ts | 82.85% <100.00%> (-2.86%) |
:arrow_down: |
Anything I could do to help get this in? It's exactly the feature I was needing.
@truk, we haven't finalized if the current approach is the best solution. You can test it in the meantime if everything is working as expected
Yeah, I guess the first thing is just to understand the scope of what this is. It looks like it's the ability to have the columns just auto-grow beyond the content width when there's space, though this doesn't cause columns to shrink and clip the text below the content width based on any relative sizes. I think the latter would be a useful feature so you could have some columns that can flex up and down and some fixed. And for this to be a column property rather than some default. I'm also noticing the scroll bug still in this branch, so maybe it's not done yet.
Can this be merged ? I also need this feature
@amanmahajan7 I'll review it tomorrow