-
-
Notifications
You must be signed in to change notification settings - Fork 531
Open
Description
material-react-table version
v.1.9.1
react & react-dom versions
v.18.2.0
Describe the bug and the steps to reproduce it
- Create a dataset.
- Leave one of the value in the top row as null or undefined.
- Create the columns and pass everything to the object. Be sure to not parse the null value as anything but null | undefined
- Notice if you try to search for anything under the column where the first value is null or undefined, Golbal Filter won't be able to find anything.
As an additional note, I have tried to make my own custom filter (filterFns) to go around the issue only to find out the entire column was absent from row (the first argument of the filter function).
Minimal, Reproducible Example - (Optional, but Recommended)
https://stackblitz.com/edit/github-5zzklf-3s8ejv?file=src/TS.tsx is the sandbox I've used for the video demo I've provided bellow.
A even more minimalistic exemple would be:
import React, { useMemo } from 'react';
import ReactDOM from 'react-dom/client';
import MaterialReactTable, { type MRT_ColumnDef } from 'material-react-table';
type Fruit = {
id: number;
fruit: string | null;
};
const data: string[] = [
{ id: 40, fruit: null },
{ id: 12, fruit: "Poire" },
{ id: 23, fruit: "Oirange" },
];
const Example = () => {
const columns = useMemo<MRT_ColumnDef<Fruit>[]>(
() => [
{ accessorKey: 'id', header: 'ID' },
{ accessorKey: 'fruit', header: 'Fruit' }
], []
);
return <MaterialReactTable columns={columns} data={data} />
}
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<Example />
</React.StrictMode>,
);Screenshots or Videos (Optional)
Do you intend to try to help solve this bug with your own PR?
No, because I do not know how
Terms
- I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Metadata
Metadata
Assignees
Labels
No labels