Skip to content
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] Is there a way to fix this right pin issue when using column grouping? #7041

Closed
2 tasks done
fionaDawn opened this issue Nov 29, 2022 · 9 comments · Fixed by #10518
Closed
2 tasks done
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Column groups Related to the data grid Column groups feature support: commercial Support request from paid users waiting for 👍 Waiting for upvotes

Comments

@fionaDawn
Copy link

Order ID 💳

51218

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

The problem in depth 🔍

Weird behavior when pinning any column to the right under the last column group

Codesandbox straight from MUI's Defining Column Group demo

Screen.Recording.2022-11-24.at.6.01.11.PM.mov

Your environment 🌎

`npx @mui/envinfo`
 System:
    OS: macOS 12.6
  Binaries:
    Node: 17.4.0 - ~/.nvm/versions/node/v17.4.0/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 8.6.0 - ~/.nvm/versions/node/v17.4.0/bin/npm
  Browsers:
    Chrome: 107.0.5304.121
    Edge: Not Found
    Firefox: Not Found
    Safari: 16.0
  npmPackages:
    @emotion/react: ^11.9.0 => 11.9.3 
    @emotion/styled: ^11.8.1 => 11.9.3 
    @mui/base:  5.0.0-alpha.85 
    @mui/icons-material:  5.8.4 
    @mui/lab:  5.0.0-alpha.86 
    @mui/material:  5.8.4 
    @mui/private-theming:  5.8.4 
    @mui/styled-engine:  5.8.0 
    @mui/styles:  5.8.4 
    @mui/system:  5.8.4 
    @mui/types:  7.1.4 
    @mui/utils:  5.10.6 
    @mui/x-data-grid:  5.17.9 
    @mui/x-data-grid-pro:  5.17.9 
    @mui/x-date-pickers:  5.0.0-alpha.6 
    @mui/x-license-pro:  5.17.0 
    @types/react:  17.0.47 
    react: ^17.0.2 => 17.0.2 
    react-dom: ^17.0.2 => 17.0.2 
    typescript:  4.7.4 
@fionaDawn fionaDawn added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Nov 29, 2022
@m4theushw m4theushw added bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! waiting for 👍 Waiting for upvotes and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Nov 29, 2022
@m4theushw
Copy link
Member

It's a limitation of column grouping. It doesn't play well with column pinning. I added "waiting for 👍" to get votes from the community to know if we should prioritize this.

@m4theushw m4theushw changed the title [question] Is there a way to fix this right pin issue when using column grouping? [data grid] Is there a way to fix this right pin issue when using column grouping? Nov 29, 2022
@mamodev
Copy link
Contributor

mamodev commented Dec 19, 2022

up vote! this is an annoyng issue

@m4theushw m4theushw moved this to 🆕 Needs refinement in MUI X Data Grid Dec 19, 2022
@fionaDawn
Copy link
Author

Is there a way to disable or remove "Pin to the right" in the meantime?

@MBilalShafi
Copy link
Member

MBilalShafi commented Mar 27, 2023

Is there a way to disable or remove "Pin to the right" in the meantime?

With the new implementation of the column menu API released in v6, you can customize the custom pinning item in the ColumnMenu to remove a pinning item until a proper fix for the bug is there.

I stripped off some logic from the default PinningItem to keep only Pin to Left part in this codesandbox example.

For more examples of how to customize the column menu, see the documentation.

Caution: ColumnMenu API will be using slots/slotProps instead of components/componentsProps in the upcoming release, here's the related PR: #7999

@claudioctonha
Copy link

Is there any way to fix this? I am facing the same issue.

@RubtsovAV
Copy link

the same

@saikumarf9
Copy link

Hey, Any update on this?

@MBilalShafi MBilalShafi added the feature: Column groups Related to the data grid Column groups feature label Sep 27, 2023
@hafley66
Copy link

Hi in the same boat here. I am trying to use pinned columns with columns that do not belong to column groups. Here is another repro, https://codesandbox.io/s/icy-sun-fx7kdr?file=/Demo.tsx

The issue happens when the "Age" column disappears after uncommenting out the pinnedColumns prop.

The true error is that the pinned columns first row of the headers is too long, you can see it in the "data-fields" attribute, it has not just the pinned columns, but also the next ungrouped column.

Screen Shot 2023-09-28 at 10 36 52

@hafley66
Copy link

https://codesandbox.io/s/pinned-and-grouped-fix-vgdpxm?file=/Demo.tsx

I manage a library that wraps this one for my company. I have spots where i add special fields to the columns defs and such, and i just figured out how to get around this.

i made sure that any col def that had no grouping was given a "phantom" group definition on behalf of the user. feel free to adopt this code.

if you dont want to center the column headers like i do in the demo, just remove the styled code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Column groups Related to the data grid Column groups feature support: commercial Support request from paid users waiting for 👍 Waiting for upvotes
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants