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

Issue with Column Order in DataGrid Column Customization #4379

Closed
2 tasks
marinamas opened this issue Feb 21, 2024 · 4 comments
Closed
2 tasks

Issue with Column Order in DataGrid Column Customization #4379

marinamas opened this issue Feb 21, 2024 · 4 comments
Assignees

Comments

@marinamas
Copy link

marinamas commented Feb 21, 2024

What package(s) are you using?

  • Carbon for IBM Products (or Carbon for IBM Cloud & Cognitive) - Yes
  • Legacy/CDAI
  • Legacy/Security

Detailed description

Describe in detail the issue you're having.
In DataGrid with column customization , when we set Initial state having Column order and hidden columns .
Though the order of the column is mentioned, it would always add the hidden columns to end of customization component.
Expected behavior would be to have the column order retained irrespective of whether the column is hidden or not

Is this issue related to a specific component?
DataGrid
What did you expect to happen? What happened instead? What would you like to
Expected behavior would be to have the column order retained in the customization component list

What browser are you working in?
Safari
Chrome

What version of the @carbon/ibm-products (or @carbon/ibm-cloud-cognitive)
2.26.0

Steps to reproduce the issue

  1. Use the DataGrid along with Column Customization.
  2. Set the initial state with hiddenColumns, columnOrder.
  3. Add few column id under hiddenColumns. Though we mention the order of Columns the customization component adds hidden
    columns at the end in the list .
  4. Though the column is hidden , the order in which it is displayed should be according to the column order

Additional information

initialState: {
columnOrder: [
"rowIndex",
"firstName",
"someone1",
"lastName",
"age",
"visits",
],
hiddenColumns: ["lastName"],
}

image

Acceptance criteria

Preview Give feedback
@github-project-automation github-project-automation bot moved this to Needs triage 🧐 in Carbon for IBM Products Feb 21, 2024
@elycheea elycheea added the needs: design opinion Design question needs opinion from designer label Feb 29, 2024
@elycheea
Copy link
Contributor

Looks like retaining column order is the intended design based on the design guidance1.

Footnotes

  1. https://pages.github.ibm.com/cdai-design/pal/components/data-table/column-customization/usage#anatomy

@elycheea elycheea moved this from Needs triage 🧐 to Needs refinement 🤓 in Carbon for IBM Products Feb 29, 2024
@elycheea elycheea removed the needs: design opinion Design question needs opinion from designer label Feb 29, 2024
@elycheea
Copy link
Contributor

Note, when investigating this — when we first uncheck a column, it does retain position at least in the tearsheet. May be some re-rendering that happens because we were able to replicate this behavior later.

@elycheea elycheea moved this from Needs refinement 🤓 to Backlog 🌋 in Carbon for IBM Products Feb 29, 2024
@marinamas
Copy link
Author

marinamas commented Mar 1, 2024 via email

@davidmenendez
Copy link
Contributor

just needs the V1 PR reviewed #4549

@github-project-automation github-project-automation bot moved this from Needs review 👋 to Done 🚀 in Carbon for IBM Products Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants