Column resizing doesn't respect `clientWidth`, bad experience with limited width tables
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 28.4k
- Forks
- 3.6k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 10
Description
TanStack Table version
8.20.6
Framework/Library version
18.3
Describe the bug and the steps to reproduce it
Take the official full width resizable table example
https://tanstack.com/table/v8/docs/framework/react/examples/full-width-resizable-table
With limited screen space, grow a column, and then grow it some more.
You'll notice that the state now has a ridiculous amount of width, while the column is still fairly small visually.
This means that to size it down_ you now need to drag the handle left a lot without much result.
The solution would be to detect that dragging is over and set the column size to the header element's clientWidth, but I'm not entirely sure how to achieve that.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://tanstack.com/table/v8/docs/framework/react/examples/full-width-resizable-table
Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
No, because I do not have time to dig into it
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the official full-width-resizable-table React example linked in the issue and reproduce the behavior with limited screen space. Inspect how resizing uses the header element and clientWidth; done means repeated growth no longer creates excessive stored width and the column can be resized down normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100