-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[data grid] Column header labels still abbreviated after Autosize Columns #15388
Comments
Hey @AndreasDBS and thanks for raising this issue here. This is actually a bug. This part of the code indicates that the mui-x/packages/x-data-grid/src/hooks/features/columnResize/useGridColumnResize.tsx Lines 222 to 223 in 284d0e5
The assumption and code looks ok, so I took a bit of time to investigate. It seems that the column headers are memoized pretty heavily and when getting the elements from the reference it is still in an old state. I tried to showcase that in this screenrecording: Screen.Recording.2024-11-13.at.11.27.58.movWhat I do here is:
It shows that the I'll add this to the board for the team to fix! |
cc @romgrk since it might be related to virtualization ☝🏼 |
@michelengelen Thanks a lot to confirm that and for your quick response. I was already trying to look into that useGridColumnResize.js but am more than happy to hand this over to you. Cheers! |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @AndreasDBS How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
Sorry, I just wanted to comment but pressed "Close with comment" by mistake. |
So, github-project-automation changed this issue from Needs refinement to Backlog - what's going on here, is this issue still in the pipeline to get fixed, or is this issue lost due to my closing it by mistake? Should I enter a new one? |
Moved it back to the 'needs refinement' lane. Thanks for the heads up! 👍🏼 |
Hi guys, just wanted to say, I know you have a lot to do, and even though we have licensed your lib we can't demand anything. As simple as this bug might look - we just cannot ship a product which hides what information is shown in columns. |
Fair enough ... If it helps I can have a look today and try to fix before the release today. |
That would be absolutely amazing, thank you! |
Hey @AndreasDBS ... I found a solution, but it is not super ideal. Opened a PR anyways with backporting to v7. Lets wait for the reviews and go from there. Is that OK for you? Good thing is that release day is today, so you could potentially use it by EOD or tomorrow! |
That sounds fantastic! (A backport would be nice, really, we might not be allowed to ship with 8.x yet). |
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Note @AndreasDBS How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey. |
The problem in depth
We are building an enterprise web app that has lots of tables, and a table may have 20 or more columns. We want columns to be as wide as required, but not wider than that. Most importantly: column headers must always be readable, no matter if the sort order has changed and the sort icon is displayed.
Here comes the problem: take your excellent documentation as an example:
docs
First, you click on Autosize Columns in that example (the Include Headers option is ticked). You can see that as a result the Brand ID column is given a width which nicely fits the Brand ID label into the header, it's not too wide and not too narrow.
Now, choose to sort for the Brand ID column. The column header now displays the Sort-Arrow icon to indicate the ordering. However, that Icon overlaps the column header label, which is then abbreviated with "...". A subsequent use of the Autosize Columns button does not fix that.
We never want column header labels to be abbreviated. So, here is the question:
Latest version tested: Mui Data Grid v7.22.2.
Your environment
`npx @mui/envinfo`
System:
OS: Windows 10 10.0.19045
Binaries:
Node: 20.17.0
npm: 10.8.2
npmPackages:
@emotion/react: ^11.13.3 => 11.13.3
@emotion/styled: ^11.13.0 => 11.13.0
@mui/base: 5.0.0-beta.58
@mui/core-downloads-tracker: 6.1.3
@mui/icons-material: ^6.1.3 => 6.1.3
@mui/lab: ^6.0.0-beta.11 => 6.0.0-beta.11
@mui/material: ^6.1.3 => 6.1.3
@mui/private-theming: 6.1.3
@mui/styled-engine: 6.1.3
@mui/system: 6.1.3
@mui/types: 7.2.18
@mui/utils: 6.1.3
@mui/x-charts: ^7.20.0 => 7.20.0
@mui/x-charts-vendor: 7.20.0
@mui/x-data-grid: 7.20.0
@mui/x-data-grid-pro: ^7.20.0 => 7.20.0
@mui/x-date-pickers: 7.20.0
@mui/x-date-pickers-pro: ^7.20.0 => 7.20.0
@mui/x-internals: 7.20.0
@mui/x-license: ^7.20.0 => 7.20.0
@types/react: ^18.2.14 => 18.2.15
react: ^18.2.0 => 18.2.0
react-dom: ^18.2.0 => 18.2.0
typescript: ^5.0.2 => 5.1.6
Search keywords: autoresize column width
Order ID: 79546
The text was updated successfully, but these errors were encountered: