Describe the bug#
When using the resizing feature on a table that is set to fill up the entire width of its parent, columnSizing state gets out of sync with the actual widths of the columns. This prevents the developer from being able to save and later restore the columnSizing state as it would lead to different results, as well as a host of other issues.
Your minimal, reproducible example#
https://codesandbox.io/s/bold-mccarthy-uwhdwy?file=/src/main.tsx
Steps to reproduce#
- open the codesandbox console so you can see the logs.
- Expand the first column to something like 200px for example.
- Then start expanding the columns the other columns.
You will notice that the first column shrinks as you expand the other columns but the columnSizing state entry for the first column keeps on having 200px as the value, not reflecting the fact that it's getting smaller. Easily verifiable but inspecting one of the tds of the first column and seeing that it's width is not equal to the width specified in its style attribute.
Expected behavior#
The columnSizing state should properly track all the widths so that it doesn't get out of sync.
How often does this bug happen?#
Every time
Screenshots or Videos#
No response
Platform#
Chrome
react-table version#
8.5.13
TypeScript version#
No response
Additional context#
No response
Terms & Code of Conduct#
The need (full-width table resize handler) is depicted here --> https://github.com/TanStack/table/issues/4825