react-tabulator icon indicating copy to clipboard operation
react-tabulator copied to clipboard

Incorrect column width calculation when table is in a container less than 100%

Open paintedbicycle opened this issue 3 years ago • 2 comments

bug: The last column of each row often wraps under the first column when using a container less than 100%.

Environment Details

  • react-tabulator version: 18.1

Long Description

  • Starting around v17.1, I noticed that the last column would wrap to under the first column in all of my tables
  • I did some digging and it turns out that this happens when the table is in a container. My content is in a container (i.e. width: 92%).
  • I believe that the table is creating set widths for the column, and inserting them as inline styles. This might be miscalculating. Just a guess.
  • I created a sandbox with a width set on the body and it recreated it. The issue is not there when the width is 100%. I also do not have this issue on version 0.15.0
  • When you make the window bigger and smaller (i.e. resizing the browser window you can see that the column often jumps around, sometimes wrapped, sometimes in the correct spot)
[Sandbox example](https://codesandbox.io/s/react-tabulator-examples-forked-luub9?file=/src/components/styles.css)
Screen Shot 2022-02-05 at 2 37 36 PM

paintedbicycle avatar Feb 05 '22 13:02 paintedbicycle

Just throwing it out there that I'm experiencing the same thing. Some assorted info in case it's useful:

  • This could either be an issue with the underlying tabulator-tables dependency or react-tabulator itself. I'm not sure at this point, but I suspect it's the former.
  • It looks like there have been a number of updates/fixes for tabulator-tables since the 5.0.10 version that react-tabulator currently uses. I tried an experiment locally where I replaced tabulator-tables with the most recent version (5.1.2), but the issue appears to still happen.

sdunham avatar Feb 21 '22 22:02 sdunham

@ngduc Just wanted to see if there's any update on this issue. Thanks!

@paintedbicycle Any luck with a workaround or fix on your end?

sdunham avatar May 18 '22 17:05 sdunham