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

Datagrid client-side filtering with custom id is broken in 6.9.1 #9562

Closed
2 tasks done
PSanetra opened this issue Jul 4, 2023 · 0 comments · Fixed by #9564
Closed
2 tasks done

Datagrid client-side filtering with custom id is broken in 6.9.1 #9562

PSanetra opened this issue Jul 4, 2023 · 0 comments · Fixed by #9564
Assignees
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature regression A bug, but worse

Comments

@PSanetra
Copy link

PSanetra commented Jul 4, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Clientside filtering on @mui/x-data-grid 6.9.1 is broken when a custom id field is used.

const columns: GridColDef[] = [
  {
    field: 'customId',
    headerName: 'Custom ID',
    type: 'number',
    width: 75,
  },
  {
    field: 'name',
    headerName: 'Name',
    type: 'string',
    width: 300,
  },
];

const rows = [
  {
    customId: 1,
    name: 'Hello',
  },
  {
    customId: 2,
    name: 'World',
  },
];

export default function App() {
  return (
    <DataGrid
      autoHeight
      columns={columns}
      getRowId={(row) => row.customId}
      rowCount={rows.length}
      rows={rows}
      slots={{
        toolbar: GridToolbar,
      }}
    />
  );
}

Example on Stackblitz

Current behavior 😯

Try to filter a column like the name on any value. The datagrid will not be filtered.

If the id column is named exactly "id" it is still working as expected:
Example on Stackblitz

Expected behavior 🤔

Clientside filtering on column which are not named "id" should work.

Context 🔦

No response

Your environment 🌎

This issue is happening with @mui/x-data-grid 6.9.1, but not with 6.9.0

Order ID or Support key 💳 (optional)

No response

@PSanetra PSanetra added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 4, 2023
@romgrk romgrk added component: data grid This is the name of the generic UI component, not the React module! regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 4, 2023
@romgrk romgrk self-assigned this Jul 4, 2023
@romgrk romgrk added the feature: Filtering Related to the data grid Filtering feature label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! feature: Filtering Related to the data grid Filtering feature regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants