Skip to content
Source
Sign inSign up
TanStack/table

columnSizing state gets out of sync with actual column sizes when used with a full width table #4880

Closedalexbu92(GitHub profile, opens in a new tab) opened this issue 1 comment

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

  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
  1. The need (full-width table resize handler) is depicted here --> https://github.com/TanStack/table/issues/4825

  2. KevinVandy closed this

Sign in to join this conversation.