-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table with enableVirtualization remains with expanded height when resizing columns with large values #1227
Comments
Thanks for reporting the issue. I think this issue might be related to #1107, and may be due to the instability in our virtual scroll behavior especially related to dynamic heights adjustment. I believe @gretanausedaite is working on getting the virtual scroll to behave correctly, which might fix this issue. We'll bring it up in our next team meeting on Monday. |
I also want to add that some height issues are totally expected with virtualization when relying on implicit height. For a more robust UI, consider these options:
|
@mayank99 I'll try to apply your suggestions when I got some time. Will report back with results hopefully by tomorrow. |
@LostABike After trying @mayank99 's suggestion's, setting a min-width for the columns that give problems when wrapped fix the issue so extra height is no longer seen. Here is a repro of the fix applied to the original example: https://codesandbox.io/s/happy-water-nwg8lm?file=/src/App.tsx I did try to truncate overflowing text, but for whatever reason couldn't figure it out, the usual "overflow: hidden; text-overflow: ellipsis; white-space: nowrap;" didn't work, only the style "white-space: nowrap;" seems to work, devtools pointed out that the styling was being applied, but somehow the cell cannot detect overflow, maybe I need to do something else because even setting a maxWidth for all of the cells in the column didn't work. For our specific use case, we have tables of thousands of rows and one of the things we have struggled with is the CLS experienced by users when switching from page to page due to varying lengths of data within specific columns and it seems that the nowrap property really helps alot in reducing its effects. Let me know if y'all know how to truncate the text in these cells as that would be really helpful. |
@orlandoortegajr In your column object, you can use the Cell: ({ value }) => <div className="my-name-cell">{value}</div> .my-name-cell {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} You should also consider using See sandbox: https://codesandbox.io/s/sleepy-pine-8xbwfo?file=/src/styles.css:155-273 (Side note: we are going to change all the Let me know if you have any other questions, or if we can close this issue. Thanks. |
@mayank99 Yup, no more questions. That is exactly what I need, looks pretty good, also yeah seems like line-clamp is a good option as well, will try it out and see. Thanks for letting me know about the class name changes, will make sure to take that into account and look into other ways of targeting elements. |
Describe the bug (actual behavior)
When you have a Table that has enableVirtualization and isResizable enabled and set pageSize (helps with visualizing the issue), if a column has a value that is large enough to significantly expand the table's height when that column is squished it will expand the table's height until its full value is visible within the new column's constraints. However, when you resize that column being squished back to accommodate for the larger value, the height does not reset, it still remains expanded.
Expected behavior
When a column with a large value is squished and re-expanded to allow for the largest value to have more space it should not have any additional height between the table body and the paginator.
Reproduction
Link to a minimal repro: https://codesandbox.io/s/thirsty-torvalds-l2tw0e?file=/src/App.tsx
Steps to reproduce
Video link that is easier to follow:
https://user-images.githubusercontent.com/38387174/233438212-77f75ffd-3443-4bbe-871c-1e9957ebc059.mp4
The text was updated successfully, but these errors were encountered: