T
TanStack3mo ago
optimistic-gold

Column drag resizing not matching cursor's movement

Hello! I am a TanStack table begginer using React. I have implemented a custom resizer handle. I feel confusing that the amount of distance that the mouse is moved does not match the column size. I don't know how to explain it properly, but in the gif you can see that the column ends in a smaller position than it should be, it does not fully follow the cursor... Is this behaviour customizable?
No description
8 Replies
conscious-sapphire
conscious-sapphire3mo ago
The demo you’re showing looks to be changing the table size rather than the column size. The movement is likely to do with how tables are rendered and sized up in HTML
optimistic-gold
optimistic-goldOP3mo ago
Hmmmmm the problem is that the "width" html attribute becomes out of sync with the real element width
No description
optimistic-gold
optimistic-goldOP3mo ago
I am going to write a simple demo of my table ...
optimistic-gold
optimistic-goldOP3mo ago
Here you have it
optimistic-gold
optimistic-goldOP3mo ago
Oh dang, I guess that the issue is due to the table having 100% width
optimistic-gold
optimistic-goldOP3mo ago
GitHub
implement full width resize handler · Issue #4825 · TanStack/table
Describe the bug The header.getResizeHandler() works well if the table is not full-width. But when working with full-width tables, it does not handle the ColumnSizingState properly. Your minimal, r...
optimistic-gold
optimistic-goldOP3mo ago
This issue has been reported multiple times but no one has given a definitive answer or fix 😅
conscious-sapphire
conscious-sapphire3mo ago
Great find. I'd either play around with the tableLayout property or perhaps change to a Grid or Flexbox layout. There are likely limitations on what can be accomplished with a display: table either due to various browser rendering quirks or that it's an older spec.

Did you find this page helpful?