GithubHelp home page GithubHelp logo

kevinvandy / mantine-react-table Goto Github PK

View Code? Open in Web Editor NEW
701.0 13.0 119.0 14.27 MB

A fully featured Mantine V5 implementation of TanStack React Table V8, forked from Material React Table

Home Page: https://www.mantine-react-table.com/

License: MIT License

TypeScript 77.57% HTML 1.70% JavaScript 3.22% CSS 1.93% Shell 0.09% MDX 15.48%
datagrid mantine tanstack-table

mantine-react-table's Introduction

Mantine React Table

View the Docs Site

A fork of Material React Table

V1 released July 18, 2023

About

Quickly Create React Data Tables with Mantine

MRT

Learn More

Quick Examples

View additional storybook examples

Features

All features can easily be enabled/disabled

Fully Fleshed out Docs are available for all features

  • < 44kb gzipped - Bundlephobia
  • Advanced TypeScript Generics Support (TypeScript Optional)
  • Aggregation and Grouping (Sum, Average, Count, etc.)
  • Click To Copy Cell Values
  • Column Action Dropdown Menu
  • Column Hiding
  • Column Ordering via Drag'n'Drop
  • Column Pinning (Freeze Columns)
  • Column Resizing
  • Customize Icons
  • Customize Styling of internal Mantine Components
  • Data Editing (4 different editing modes)
  • Density Toggle
  • Detail Panels (Expansion)
  • Filtering (supports client-side and server-side)
  • Filter Match Highlighting
  • Full Screen Mode
  • Global Filtering (Search across all columns, rank by best match)
  • Header Groups & Footers
  • Localization (i18n) support
  • Manage your own state or let the table manage it internally for you
  • Pagination (supports client-side and server-side)
  • Row Actions (Your Custom Action Buttons)
  • Row Numbers
  • Row Ordering via Drag'n'Drop
  • Row Selection (Checkboxes)
  • SSR compatible
  • Sorting (supports client-side and server-side)
  • Theming (Respects your Mantine Theme)
  • Toolbars (Add your own action buttons)
  • Tree Data / Expanding Sub-rows
  • Virtualization (@tanstack/react-virtual)

Getting Started

Installation

View the full Installation Docs

  1. Ensure that you have React 17 or later installed

  2. Install Peer Dependencies (Mantine V6 and Tabler Icons)

npm install @mantine/core @mantine/hooks @mantine/dates @emotion/react @tabler/icons-react dayjs
  1. Install mantine-react-table
npm install mantine-react-table

@tanstack/react-table, @tanstack/react-virtual, @tanstack/match-sorter-utils, are internal dependencies, so you do NOT need to install them yourself.

Usage

Read the full usage docs here

import { useMemo, useState, useEffect } from 'react';
import { MantineReactTable, useMantineReactTable } from 'mantine-react-table';

const data = [
  {
    name: 'John',
    age: 30,
  },
  {
    name: 'Sara',
    age: 25,
  },
]

export default function App() {
  const columns = useMemo(
    () => [
      {
        accessorKey: 'name', //simple recommended way to define a column
        header: 'Name',
        mantineTableHeadCellProps: { style: { color: 'green' } }, //optional custom props
        Cell: ({ cell }) => <span>{cell.getValue()}</span>, //optional custom cell render
      },
      {
        accessorFn: (row) => row.age, //alternate way
        id: 'age', //id required if you use accessorFn instead of accessorKey
        header: 'Age',
        Header: () => <i>Age</i>, //optional custom header render
      },
    ],
    [],
  );

  //optionally, you can manage any/all of the table state yourself
  const [rowSelection, setRowSelection] = useState({});

  useEffect(() => {
    //do something when the row selection changes
  }, [rowSelection]);

  const table = useMantineReactTable({
    columns,
    data,
    enableColumnOrdering: true, //enable some features
    enableRowSelection: true,
    enablePagination: false, //disable a default feature
    onRowSelectionChange: setRowSelection, //hoist row selection state to your state
    state: { rowSelection },
  });
  
  return <MantineReactTable table={table} />;
}

Open in Code Sandbox

Contributors

PRs are Welcome, but please discuss in GitHub Discussions or the Discord Server first if it is a large change!

Read the Contributing Guide to learn how to run this project locally.

mantine-react-table's People

Contributors

alessandrojcm avatar alexandereklf avatar calamarico avatar dbnar2 avatar denisbessa avatar dmhumphrey avatar enyelsequeira avatar fredericbahr avatar gaspardip avatar gioqw avatar joshrosenblum avatar kevinvandy avatar kiledonley avatar laratran avatar mintaka2479 avatar nakeva avatar naughton avatar oliviertassinari avatar pjtilsworth avatar pointsingularity avatar posabsolute avatar samiya-alyaaribi avatar simon-v-swyftx avatar songkeys avatar stevenlollivierpoc avatar stringke avatar takosua avatar timhaak avatar umarmw avatar volene avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mantine-react-table's Issues

Custom action menu shows 'EDIT' menu item with editing mode set to 'table'

mantine-react-table version

v1.0.0-beta.10

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

With table editingMode set to 'table' and with custom actiom menu there is a bug: edit option is still present, while it should not.

Minimal, Reproducible Example - (Optional, but Recommended)

<MantineReactTable
      editingMode={document?.status == "Draft" ? "table" : ""}
      enableEditing
      enableRowActions
      renderRowActionMenuItems={({ row }) => [
        <Menu.Item onClick={() => console.info("Delete")}>Delete</Menu.Item>,
      ]}
    />

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Next.js v13 crash by MRT_TablePagination

mantine-react-table version

1.0.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

I'm using Next.js v13.3.4 (pages routing) with SWR v2.1.5

I'm rendering an array of data fetched first through the swr. Can't find a possible issue there, I'm using much extended configuration but at the basic version below the issue appears anyway

The error is not showing immediately, the 1st render goes successfully - also, all of the data has required field. I can see the correct (and expected layout) but right after that the app is getting crashed.

I think that it's worth to mention that changing paginationDisplayMode to pages fixes the problem. Disabling pagination as well but it's not the solution I'm interested in

 const columns = useMemo<MRT_ColumnDef<Item>[]>(
        () => [
            {
                header: COLUMN_LABELS.title.label,
                enableColumnFilters: false,
                accessorKey: COLUMN_LABELS.title.accessor
            }
            ], 
          [])
 const table = useMantineReactTable({
        columns,
        data: itemsList ?? []
        })
        

image

Minimal, Reproducible Example - (Optional, but Recommended)

^

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

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.

State update on a component that has not been mounted yet

mantine-react-table version

v1.0.0-beta.8

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

The initial load fails when used in combination with React Suspense and async data load, such as React Query with suspense: true. The table does appear to work fine afterwards, and it only happens when refreshing the page. I'm building a Next.js app with Blitz.js for auth + data loading, and this causes the issue on initial data load.

I have verified that this is not a problem with alternative components, such as Mantine Datatable, so it appears to be an issue somewhere inside the MRT_TableRoot component.

Minimal, Reproducible Example - (Optional, but Recommended)

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Next.js v13 crash by MRT_TablePagination

mantine-react-table version

1.0.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

I'm using Next.js v13.3.4 (pages routing) with SWR v2.1.5

I'm rendering an array of data fetched first through the swr. Can't find a possible issue there, I'm using much extended configuration but at the basic version below the issue appears anyway

The error is not showing immediately, the 1st render goes successfully - also, all of the data has required field. I can see the correct (and expected layout) but right after that the app is getting crashed.

I think that it's worth to mention that changing paginationDisplayMode to pages fixes the problem. Disabling pagination as well but it's not the solution I'm interested in

 const columns = useMemo<MRT_ColumnDef<Item>[]>(
        () => [
            {
                header: COLUMN_LABELS.title.label,
                enableColumnFilters: false,
                accessorKey: COLUMN_LABELS.title.accessor
            }
            ], 
          [])
 const table = useMantineReactTable({
        columns,
        data: itemsList ?? []
        })
        

image

Minimal, Reproducible Example - (Optional, but Recommended)

^

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

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.

renderDetailPanel mount other row components even only one row is expanded

mantine-react-table version

v1.0.0-beta.7

react & react-dom versions

v18

Describe the bug and the steps to reproduce it

I just logged the row in console. Expanding one will also log other rows even it is close.
I wanted to fetch something only if its expanded.
Is there any way to check if the current renderDetailPanel is expanded or not as a workaround ?

import React, { useMemo } from "react";
import { MantineReactTable, MRT_ColumnDef } from "mantine-react-table";
import { Box, Text } from "@mantine/core";
import { data, Person } from "./makeData";

const Example = () => {
  const columns = useMemo(
    () =>
      [
        {
          accessorKey: "id",
          header: "ID",
          size: 50
        },
        {
          accessorKey: "firstName",
          header: "First Name"
        },
        {
          accessorKey: "middleName",
          header: "Middle Name"
        },
        {
          accessorKey: "lastName",
          header: "Last Name"
        }
      ] as MRT_ColumnDef<Person>[],
    []
  );

  return (
    <MantineReactTable
      columns={columns}
      data={data}
      renderDetailPanel={({ row }) => {
        console.log("row", JSON.stringify(row, null, 2));
        return (
          <Box
            sx={{
              display: "grid",
              margin: "auto",
              gridTemplateColumns: "1fr 1fr",
              width: "100%"
            }}
          >
            <Text>Address: {row.original.address}</Text>
            <Text>City: {row.original.city}</Text>
            <Text>State: {row.original.state}</Text>
            <Text>Country: {row.original.country}</Text>
          </Box>
        );
      }}
    />
  );
};

export default Example;

Minimal, Reproducible Example - (Optional, but Recommended)

image

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

None

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.

Bottom toolbar custom actions introduce padding (that probably should not be there)

mantine-react-table version

1.0.0

react & react-dom versions

18

Describe the bug and the steps to reproduce it

  1. Override 'renderBottomToolbarCustomActions'
  2. Add any custom action (for example a button)
  3. The container for both the action and the pagination now has a padding, which is correct I think
  4. However the pagination still has its old padding and therefore the total row height is now larger than before

Temporary I could fix this with

mantineBottomToolbarProps: { sx: { '> div': { paddingTop: 0, paddingBottom: 0, }, }, },

The screenshot shows the behavior. The total space above the pagination is larger with a custom action than without one

Minimal, Reproducible Example - (Optional, but Recommended)

enablePagination: true,
enableBottomToolbar: true,
renderBottomToolbarCustomActions: () => {
    return <div>content</div>
}

Screenshots or Videos (Optional)

image

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.

Infinite Scroll example crashes on Firefox

mantine-react-table version

v0.9.3

react & react-dom versions

Whatever is in the example

Describe the bug and the steps to reproduce it

Scrolling in Firefox will result in crashing the component. This occurs in the example online, but this output is from the example running locally.

10:17:10.180 Uncaught Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
    React 3
    onChange index.tsx:31
    notify index.ts:353
    _measureElement index.ts:588
    measureElement index.ts:597
    ref MRT_TableBodyRow.tsx:78
    React 14
    workLoop scheduler.development.js:266
    flushWork scheduler.development.js:239
    performWorkUntilDeadline scheduler.development.js:533
    js scheduler.development.js:571
    js scheduler.development.js:633
    __require chunk-DFKQJ226.js:8
    js index.js:6
    __require chunk-DFKQJ226.js:8
    React 2
    __require chunk-DFKQJ226.js:8
    js React
    __require chunk-DFKQJ226.js:8
    <anonymous> chunk-I56DSPBQ.js:6058
react-dom.development.js:27292:10

Minimal, Reproducible Example - (Optional, but Recommended)

https://www.mantine-react-table.com/docs/examples/infinite-scrolling

Screenshots or Videos (Optional)

No response

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.

Row selection performance issue

mantine-react-table version

1.2.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Minimal, Reproducible Example - (Optional, but Recommended)

You can also reproduce it at https://codesandbox.io/s/github/KevinVandy/mantine-react-table/tree/main/apps/mantine-react-table-docs/examples/advanced/sandbox?file=/src/TS.tsx

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

None

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.

Cannot read properties of undefined reading id when using grouped columns

mantine-react-table version

1.0.0-beta.8

react & react-dom versions

17

Describe the bug and the steps to reproduce it

1 of 2 unhandled errors

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'id')

Call Stack
eval
node_modules/mantine-react-table/dist/esm/mantine-react-table.esm.js (1903:61)

I am getting this error. The error is caused by the creation of grouped columns under the categories of Roles and Departments.

const groupedRoleCols = [
{
id: "roles",
header: "Roles",
columns: roleCols,
},
];

Departments is created in the same way. The role cols is an array of columns conforming to the Mantine React Table requirements.

  1. Removal of the column groupings removes the bug.
  2. I am using the same component on another page with different data values BUT the same data structure and it works WITH the grouped columns.

This error only began occurring on Friday after I had committed some code. After committing I went to make a tiny styling change, and the error happened for the first time. Please note, at this point I was using grouped columns, this had previously not caused this error. In effect the error seems to have happened without any changes to my code, so as I am sure you can understand I am very confused.

I have absolutely no idea why this error is occurring.

Minimal, Reproducible Example - (Optional, but Recommended)

n/a

Screenshots or Videos (Optional)

n/a

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.

State isLoading is not working since V1.0.0-beta.19

mantine-react-table version

V1.0.0-beta.19

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Since version beta.19 the parameter for state: isLoading is not working

Minimal, Reproducible Example - (Optional, but Recommended)

return (
    <MantineReactTable
      autoResetPageIndex={false}
      columns={columns}
      data={tableData}
      enableSorting={false}
      enableEditing={true}
      enablePagination={false}
      editingMode="cell"
      enableRowVirtualization={true}
      state={{ isLoading }}
      mantineProgressProps={() => ({
        variant: "determinate", // if you want to show exact progress value
        value: loadingProgress, // value between 0 and 100
      })}
      rowVirtualizerProps={{
        overscan: 10, // adjust the number or rows that are rendered above and below the visible area of the table
        estimateSize: () => 70, // if your rows are taller than normal, try tweaking this value to make scrollbar size more accurate
      }}
      initialState={{ showGlobalFilter: true }}
    />
  );

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Column pinning selection opacity issue

mantine-react-table version

1.2.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

When we pin the colums to left or right and there are columns behind with row selection enabled the opacity of hover and selected row will make it so that the text behind the pinned columns overlap.

image

Minimal, Reproducible Example - (Optional, but Recommended)

Attached the screenshot and the code is below.

`
import { useState } from 'react';
import { MantineReactTable, useMantineReactTable } from 'mantine-react-table';
import { columns, data as initialData } from './makeData';
import { ActionIcon, Box } from '@mantine/core';
import { IconEdit, IconSend, IconTrash } from '@tabler/icons-react';

export const Example = () => {
const [data, setData] = useState(initialData);

const table = useMantineReactTable({
columns,
data,
enableRowSelection: true,
enableRowActions: true,
enablePinning: true,
renderRowActions: ({ row }) => (
<Box sx={{ display: 'flex', flexWrap: 'nowrap', gap: '8px' }}>
<ActionIcon
color="blue"
onClick={() =>
window.open(
mailto:[email protected]?subject=Hello ${row.original.firstName}!
)
}
>


<ActionIcon
color="orange"
onClick={() => {
table.setEditingRow(row);
}}
>


<ActionIcon
color="red"
onClick={() => {
data.splice(row.index, 1); //assuming simple data table
setData([...data]);
}}
>



),
});

return ;
};

export default Example;

`

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Pagination count for first item is wrong if data is an empty array

mantine-react-table version

v1.0.0-beta.3

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

If the table data is entry and the empty state text, the pagination shows the wrong counts:

Currently it shows 1-0 of 0
It should be 0-0 of 0 as in Material React Table from my point of view

The wrong place as far as i can spot: https://github.com/KevinVandy/mantine-react-table/blob/main/packages/mantine-react-table/src/toolbar/MRT_TablePagination.tsx#L97
Probably one should check if the data is empty and then only add +1

Minimal, Reproducible Example - (Optional, but Recommended)

{${firstRowIndex + data.length===0 ? 0 : 1}-${lastRowIndex} ${ localization.of } ${totalRowCount}}

Screenshots or Videos (Optional)

Do you intend to try to help solve this bug with your own PR?

None

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.

Cannot get the rendered value

mantine-react-table version

v1.0.0

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

I cannot get the rendered value of cell using the table API or column API.

Usecase

  • Data in API is in Date JSON format (1981-07-21T00:10:18.453Z)
  • I am showing Date of Birth in table in format 21 Jul 1981 using Cell option (custom ReactNode)
  • I have enabled clickToCopy for this column. On copy, I get the Date JSON and not date which I see (DD MM YYYY)
  • The same issue is with Export Date. In downloaded CSV I get Date JSON and not date in format DD MM YYYY

I expect that we can get the renderedValue in cells instance or column instance so that I can export the data the same we see.
Also onClickToCopy the rendered value should be copied and not original value.

Minimal, Reproducible Example - (Optional, but Recommended)

  • Users Date with date of birth
  • Date of Birth not coming in proper format.
  • We have no option to get rendered value.

FYI: I have tried the getValue, renderValue methods but it doesn't return renderedValue

Screenshots or Videos (Optional)

Screenshot 2023-07-24 at 11 48 15 PM Screenshot 2023-07-24 at 11 48 40 PM

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Selecting row does not update table.getIsSomeRowsSelected()

mantine-react-table version

1.0.0-beta.8

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Example from documentation about Toolbar Customization Guide does not work. table.getIsSomeRowsSelected() does not update on row selection.

Minimal, Reproducible Example - (Optional, but Recommended)

renderTopToolbarCustomActions={({ table }) => {

          console.log(table.getIsSomeRowsSelected())
          return <Box sx={{ display: "flex", gap: "16px", padding: "4px" }}>
            <Button
              color="teal"
              onClick={() => {
                alert("Create New Account");
              }}
              variant="filled"
            >
              Create Account
            </Button>
            <Button
              color="red"
              disabled={!table.getIsSomeRowsSelected()}
              onClick={() => {
                alert("Delete Selected Accounts");
              }}
              variant="filled"
            >
              Delete Selected Accounts
            </Button>
          </Box>
        }}

Screenshots or Videos (Optional)

No response

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.

Unable to hide table footer

mantine-react-table version

1.2.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

I am using the example tables on stackblitz and even after setting
enableTableFooter: false, mantineTableFooterProps: { sx: { display: 'none', }, },

I am unable to hide the footer. Looks like the only way to hide the footer is to use MRT_Table.

image

Minimal, Reproducible Example - (Optional, but Recommended)

`import { MantineReactTable, useMantineReactTable } from 'mantine-react-table';
import { columns, data } from './makeData';

const Example = () => {
const table = useMantineReactTable({
columns,
data,
enablePagination: false,
enableTableFooter: false,
mantineTableFooterProps: {
sx: {
display: 'none',
},
},
mantineTableContainerProps: {
sx: {
maxHeight: '80vh',
},
},
});

return ;
};

export default Example;`

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Dynamic row selection

mantine-react-table version

v0.7.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

const [selectMode, setSelectMode] = useState(false)
....
const enableSelectMode = () => {
    setSelectMode(true)
}

...

<MantineReactTable
...
enableRowSelection={selectMode}
/>

First of all, thanks for creating this library.
I tried updating the row selection mode dynamically after first render, it does not change.

How can I solve this issue?

Minimal, Reproducible Example - (Optional, but Recommended)

// No need for reproduction because I already included the code

Screenshots or Videos (Optional)

No response

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.

enableGrouping: false on Column is not respected with enableColumnDragging on table

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

  • define enableGrouping: false on column level
  • enableColumnDragging and enableGrouping on table level

Column with enableGrouping: false has a drag handle and could be grouped by dragging it to toolbar.

Minimal, Reproducible Example - (Optional, but Recommended)

https://stackblitz.com/edit/github-fpd6as-vs8gou?file=src/TS.tsx

import React, { useMemo } from 'react';
import { MantineReactTable, MRT_ColumnDef } from 'mantine-react-table';
import { data, Person } from './makeData';

const Example = () => {
  const columns = useMemo<MRT_ColumnDef<Person>[]>(
    () => [
      {
        accessorKey: 'firstName',
        header: 'First Name',
        enableGrouping: false,  //disable column grouping for this column,
      },
      {
        accessorKey: 'lastName',
        header: 'Last Name',
      },
    ],
    []
  );

  return (
    <MantineReactTable
      columns={columns}
      data={data}
      enableColumnDragging
      enableGrouping
    />
  );
};

export default Example;

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Server sorting breaks only when editingMode is 'table'

mantine-react-table version

1.0.0-beta.25

react & react-dom versions

v18

Describe the bug and the steps to reproduce it

Clicking on the sort icon the first 2 times work normally, but it stops working after that.

It only happens only when editingMode is 'table'.

Minimal, Reproducible Example - (Optional, but Recommended)

const [sorting, setSorting] = useState([]);

const table = useMantineReactTable({
  enableEditing: true,
  editingMode: "table",
  columns,
  data,
  manualSorting: true,
  state: { sorting },
  onSortingChange: setSorting,
});

return <MantineReactTable table={table} />;

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Drag and Drop rows doesn't work on mobile

mantine-react-table version

1.0.0-beta.11

react & react-dom versions

17.0.2

Describe the bug and the steps to reproduce it

First of all, I'd like to say thank you so much for the tremendous effort you put in this amazing library. 👏
Secondly, the bug. It's simple to explain. The DnD feature of table doesn't work on mobile (I tested on Firefox/Android and Chrome/Android).

Most DnD libraries allow consumers to use different "backends" to enable touch controls. See https://react-dnd.github.io/react-dnd/docs/backends/touch

I think one path forward here is to allow the table consumer to supply custom backends as well. Let me know what you think.

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/github/KevinVandy/mantine-react-table/tree/main/apps/mantine-react-table-docs/examples/enable-row-ordering/sandbox

https://zd9qo7-3001.csb.app/

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

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.

Strange but on renderDetails and more!

mantine-react-table version

v1.0.0

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

Hello, I had a very strange bug happening on my table.
Stack: Nextjs13 pages router, Mantine, and MRT v1.0.0

The problem is the page "broken" when I press to open the detailPanel. Nothing shows at console on the browser, the browser freezes, and I can check nothing on console or network.

I will share the code and video.

On video you guys can see nothing happens when press the button, I tried to open the console but the tab is frozen, I need to open another tab (the logs are from loom so, on really not is showing on the console.log.

The strange, is I hace another tables working fine! Today, when I create this new one, this feature not open, not work any more, the old one still works, but a new one (I create tons of new ones, different pages, and nothing)

I already tried remove and add the package, remove all node_modules and install again, but nothing fixed.

Please help!

video: https://www.loom.com/share/13ae063d7bfd450487e3a823cab0c449

Code:

import { MRT_ColumnDef, MantineReactTable, useMantineReactTable } from 'mantine-react-table'
import { type NextPage } from 'next'
import React, { useEffect, useMemo } from 'react'


const HomePage: NextPage = () => {
const data = [
    {
        id: 1,
        name: "John Doe",
        email: "[email protected]",
        roles: {
            profiles: ["admin"],
            permissions: [
                {
                    action: ["read"],
                    subject: "settings"
                }
            ]
        }
    }
]
  const columns = useMemo<MRT_ColumnDef<typeof data[number]>[]>(() => [
    {
      accessorKey: 'id',
      header: 'ID',
    },
    {
      accessorKey: 'name',
      header: 'Name',
    }
  ], [])

  const table = useMantineReactTable({
    data,
    columns,
    renderDetailPanel: () => (<div>Hello World</div>)
  })

  return <div>
    <MantineReactTable table={table} />
  </div>
}

export default HomePage

Minimal, Reproducible Example - (Optional, but Recommended)

import { MRT_ColumnDef, MantineReactTable, useMantineReactTable } from 'mantine-react-table'
import { type NextPage } from 'next'
import React, { useEffect, useMemo } from 'react'


const HomePage: NextPage = () => {
const data = [
    {
        id: 1,
        name: "John Doe",
        email: "[email protected]",
        roles: {
            profiles: ["admin"],
            permissions: [
                {
                    action: ["read"],
                    subject: "settings"
                }
            ]
        }
    }
]
  const columns = useMemo<MRT_ColumnDef<typeof data[number]>[]>(() => [
    {
      accessorKey: 'id',
      header: 'ID',
    },
    {
      accessorKey: 'name',
      header: 'Name',
    }
  ], [])

  const table = useMantineReactTable({
    data,
    columns,
    renderDetailPanel: () => (<div>Hello World</div>)
  })

  return <div>
    <MantineReactTable table={table} />
  </div>
}

export default HomePage

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

can't seem to use the built in mantine-react-table typescript definition

mantine-react-table version

0.94

react & react-dom versions

^18.2.0

Describe the bug and the steps to reproduce it

after cleaning my node_modules it happens,
before u can import the type definition from the package without type error or need to install extra packages

Minimal, Reproducible Example - (Optional, but Recommended)

image

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

None

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.

Scrollbar appears when column resizing is enabled

mantine-react-table version

v0.9.5

react & react-dom versions

v17

Describe the bug and the steps to reproduce it

With column resizing enabled, a scrollbar appears on the bottom. This appears to be from MRT_TableHeadCellResizeHandle overflowing the header. I am using Chrome Version 111.0.5563.146.

Minimal, Reproducible Example - (Optional, but Recommended)

Visible in the official docs: https://www.mantine-react-table.com/docs/guides/column-resizing#column-resize-mode

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Action dropdown menu not fully visible with virtualisation enabled

mantine-react-table version

v0.9.5

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

When the virtualisation in ON (enableColumnVirtualization, enableRowVirtualization flags enabled), and in the same time renderRowActionMenuItems defined with any number of Menu items, the menu dropdown is cropped and the visible part reflects the boundaries of the cell with the action activator. The rest of the content is hidden.

The menu dropdown is displayed corretly with the virtualisation disabled.

Minimal, Reproducible Example - (Optional, but Recommended)

See the screenshots.

Screenshots or Videos (Optional)

Screenshot 2023-04-04 at 11 03 32

Screenshot 2023-04-04 at 11 04 07

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Getting null exception while using Heading Group if enableColumnVirtualization is true

mantine-react-table version

1.0.0-beta.27

react & react-dom versions

18.0.2

Describe the bug and the steps to reproduce it

Getting null exception while using Heading Group if enableColumnVirtualization is true.

Use below link to reproduce the issue : https://codesandbox.io/p/sandbox/crimson-forest-p4vv29?file=%2Fsrc%2FmakeData.ts%3A208%2C14

Check the console for errors.

if enableColumnVirtualization is false all are working normally. Hope this detail is enough. Let me know of any additional help is needed to reproduce.

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/crimson-forest-p4vv29?file=%2Fsrc%2FmakeData.ts%3A208%2C14

Screenshots or Videos (Optional)

Screenshot 2023-07-15 at 11 23 02 PM

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.

state.isLoading spinner can be scrolled past when table has a sticky footer.

mantine-react-table version

1.1.1

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

For sticky footer tables the isLoading state's "loading spinner" is only visible for the top of the table.

If the user scrolls down he will not see the spinner.

This is especially noticeble if there is data in the table already.

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/vibrant-wu-zxwdhf?file=/src/TS.tsx:40,20

Screenshots or Videos (Optional)

Screenshot 2023-08-18 at 10 48 42

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Striped styles broken with renderDetailPanel

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

When using renderDetailPanel all rows appear striped, this appears to be caused by renderDetailPanel rendering an additional tr element. Disabling detailPanel fixes the issue.

Minimal, Reproducible Example - (Optional, but Recommended)

const columns = useMemo<
  MRT_ColumnDef<{
    id: string;
    name: string;
  }>[]
>(
  () => [
    {
      header: "ID",
      accessorKey: "id",
    },
    {
      header: "Name",
      accessorKey: "name",
    },
  ],
  []
);

return (
  <MantineReactTable
    columns={columns}
    data={[
      {
        id: "1",
        name: "John Doe",
      },
      {
        id: "2",
        name: "Jane Doe",
      },
    ]}
    renderDetailPanel={() => {
      return null;
    }}
    mantineTableProps={{
      striped: true,
    }}
  />
);

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Drag and drop is not working

mantine-react-table version

v0.9.3

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

when i using props about column or row drag with other library called react-dnd-treeview or react-arborist, drag and drop is not working. i think react-dnd is conflicting. could you please check this bug?

Minimal, Reproducible Example - (Optional, but Recommended)

.

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Enabling enableRowVirtualization breaks renderDetailPanel

mantine-react-table version

1.0.0-beta.3

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

  • add enableRowVirtualization
  • add renderDetailPanel with any content

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/nice-curie-487wd6?welcome=true&file=%2FREADME.md

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

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.

creatingRow state not able to be hoisted

Discussed in #155

Originally posted by ctretyak October 3, 2023
I found only 3 mentions and none of them is calling it. It doesn't work?
I'd like to subscribe when table.setCreatingRow / setEditingRow is called. onEditingRowChange works perfectly, but onCreatingRowChange is never called

image

React does not recognize the `rowsPerPageOptions` prop on a DOM element

mantine-react-table version

1.0.0-beta.8

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

When defining 'rowsPerPageOptions' props this way:

const PAGE_SIZES = ['5', '10', '15'];

<MantineReactTable
mantinePaginationProps={{
rowsPerPageOptions: PAGE_SIZES,
}}
...someOtherProps

React warns in the console: "React does not recognize the rowsPerPageOptions prop on a DOM element"

Minimal, Reproducible Example - (Optional, but Recommended)

const PAGE_SIZES = ['5', '10', '15'];

<MantineReactTable
mantinePaginationProps={{
rowsPerPageOptions: PAGE_SIZES,
}}
...someOtherProps

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Tooltip gets stuck

mantine-react-table version

0.9.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

When the element goes to disabled state, the tooltip wrapping that element stucks in the page.

Is there a way to completely disable tooltips?

Can be reproduced by filling the search box and clicking the clear (x) button

Screenshot 2023-02-16 at 10 52 28

Screenshot 2023-02-16 at 10 52 41

Minimal, Reproducible Example - (Optional, but Recommended)

Codesandbox

Screenshots or Videos (Optional)

No response

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.

Customizing a component doesn't work properly

mantine-react-table version

v1.0.0-beta.8

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

Customizing components doesn't work correctly. For example, setting a color for the header using mantine theme variables as described in the docs. Also the '!important' property is needed for the font size etc... I am sharing Stackblitz example.

Other than these, some storybook examples don't work either. Example

Minimal, Reproducible Example - (Optional, but Recommended)

https://stackblitz.com/edit/github-qsmw6h?file=src%2FTS.tsx

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Infinite rerendering when using useMantineReactTable if enablePagination is true or not supplied

mantine-react-table version

v1.0.0-beta.21

react & react-dom versions

v18

Describe the bug and the steps to reproduce it

Use this component, and see console, it logs the data indefinitely

"use client";
import React, { useMemo } from "react";
import {
  MantineReactTable,
  useMantineReactTable,
  type MRT_ColumnDef,
} from "mantine-react-table";

const Table= () => {
  const defaultValue = {
    a: "Test",
    b: "Test",
    c: "Test",
    d: "Test",
    e: "Test",
  };
  const data = [defaultValue];

  console.log("data", JSON.stringify(data, null, 2));

  const columns = useMemo<MRT_ColumnDef<typeof defaultValue>[]>(
    () => [
      {
        accessorKey: "a",

        header: "First Name",
      },
      {
        accessorKey: "b",

        header: "Last Name",
      },
      {
        accessorKey: "c",

        header: "Address",
      },
      {
        accessorKey: "d",

        header: "City",
      },
      {
        accessorKey: "e",

        header: "State",
      },
    ],
    []
  );

  const table = useMantineReactTable({
    columns,
    data,
    enablePagination: true, // true or remove this property to replicate
  });
  return <MantineReactTable table={table} />;
};

export default Table;

Minimal, Reproducible Example - (Optional, but Recommended)

I modify Basic Example and put data into inside the component
https://codesandbox.io/p/sandbox/funny-davinci-v6t5kl

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Something went wrong with a type "MRT_TableOptions<T>" after 1.3.0

mantine-react-table version

1.3.1

react & react-dom versions

18.2

Describe the bug and the steps to reproduce it

After update to 1.3.1 VSCode doesn't show suggestions on variables typed with MRT_TableOptions where T extends Record<string, any>
1.3.1:
image
1.2.1:
image

Minimal, Reproducible Example - (Optional, but Recommended)

install 1.3.1 and ctrl+space on any variable typed with MRT_TableOptions where T extends Record<string, any>

import { MRT_TableOptions } from "mantine-react-table";

export function useMRTFormValidation<T extends Record<string, any>>(
    options: MRT_TableOptions<T>,
): typeof options {

    return {

    } as MRT_TableOptions<T>;
}

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Reset Order doesn't respects positionActionsColumn="last" property

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

  • Set positionActionsColumn="last" property, enableRowActions, renderRowActions
  • Click Show/Hide columns
  • Click Reset Order

Actions column jumps to the left

Minimal, Reproducible Example - (Optional, but Recommended)

 <MantineReactTable
  columns={columns}
  data={data}
  positionActionsColumn="last"
  enableColumnOrdering
  enableRowActions
  renderRowActions={({ row }) => {
    return <ActionIcon>A</ActionIcon>;
  }}
/>

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

mantineFilterSelectProps data attribute

mantine-react-table version

1.0.0-beta.5

react & react-dom versions

18.0.28/18.0.11

Describe the bug and the steps to reproduce it

mantineFilterSelectProps has the following typings Partial(SelectProps) & HTMLPropsRef<HTMLInputElement> where both SelectProps and HTMLInputElement has data attribute.

There is a filterSelectOptions prop which partially solves the issue. If you want to pass other Select props, mantineFilterSelectProps will override options.

Maybe there should be an alias like htmlData for HTMLProps. Omitting data from SelectProps may be confusing and not reusable.

Thanks.

Minimal, Reproducible Example - (Optional, but Recommended)

// Type 'string[]' is not assignable to type 'readonly (string | SelectItem)[] & string'.
// Type 'string[]' is not assignable to type 'string'

const columns: MRT_ColumnDef<Reptilian>[] = [
  { filterVariant: 'select', mantineFilterProps: [{ data: ['hey'] }],
]
// works fine
const columns: MRT_ColumnDef<Reptilian>[] = [
  { filterVariant: 'select', filterSelectOptions: ['hey'],
]
// runtime error 'cannot read properties of undefined (reading 'map')'
const columns: MRT_ColumnDef<Reptilian>[] = [
  { filterVariant: 'select', filterSelectOptions: ['hey'], mantineFilterSelectProps: { sx: { width: 500 } }
]
// same error as in example 1
// when data is manually omitted in html, filterSelectOptions is overridden by data from mantineFilterSelectProps
const columns: MRT_ColumnDef<Reptilian>[] = [
  { filterVariant: 'select', filterSelectOptions: ['hey'], mantineFilterSelectProps: { data: ['hey hey hey'], sx: { width: 500 } }
]

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

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.

404 on documentation

mantine-react-table version

.

react & react-dom versions

.

Describe the bug and the steps to reproduce it

Website documentation is giving 404, I don't know whether or not because you have this is a private project on Vercel.

Minimal, Reproducible Example - (Optional, but Recommended)

Open https://www.mantine-react-table.com/ in the browser returns 404

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I think I know how to fix it and will discuss it in the comments of this issue

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.

Missing props validation on Cell when defining columns

mantine-react-table version

v1.0.0

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

When defining columns for table, I am getting missing props validation from ESlint (first screenshoot). It occuried in earlier beta versions of v1 as well, but it can be turned of by using /* eslint-disable react/prop-types */. Is this bug related to ESlint or table? I have latest version of ESlint, Prettier as well as TypeScript.

Another ESlint warning is react/no-unstable-nested-components (second screenshoot), which can be turned off by last rule in ESlint config I attached.

'react/no-unstable-nested-components': [
      'error',
      {
        allowAsProps: true,
      },
    ],

Basically it complains about React will see a new component type on every render and destroy the entire subtree’s DOM nodes and state. But I need to use some data from hooks, use them to render component for Cell, so I dont know how to do that properly. Is this the right way tho and ESlint just trying to warn me or is this a bad way to do it? I just followed your examples .

Here are my columns:

const columns = useMemo<MRT_ColumnDef<TSpecimen>[]>(
    () => [
      {
        accessorKey: 'mutation',
        header: t('table.mutations'),
        maxSize: 110,
        Cell: ({ cell }) =>
          mutations.find((m) => m.id === Number(cell.getValue<string>()))?.name,
      },
      {
        accessorKey: 'publicationDate',
        header: t('table.publication_date'),
        Cell: ({ cell }) =>
          formatDateWithDashesToString(cell.getValue<string>()),
      },
      {
        accessorKey: 'name',
        header: t('table.name'),
      },
      {
        accessorKey: 'publication',
        header: t('table.publication'),
        maxSize: 110,
        Cell: ({ cell }) =>
          publications.find((p) => p.id === Number(cell.getValue<string>()))
            ?.name,
      },
      {
        accessorKey: 'number',
        header: t('table.number'),
        maxSize: 110,
      },
      {
        accessorKey: 'pagesCount',
        header: t('table.pages_count'),
        maxSize: 110,
      },
      {
        id: `owner${owners[0].name}`,
        accessorKey: 'owner',
        header: owners[0].name,
        Cell: ({ row }) => <OwnersBarCodeCell row={row} ownerRow={0} />,
      },
      {
        id: `owner${owners[1].name}`,
        accessorKey: 'owner',
        header: owners[1].name,
        Cell: ({ row }) => <OwnersBarCodeCell row={row} ownerRow={1} />,
      },
      {
        id: `owner${owners[2].name}`,
        accessorKey: 'owner',
        header: owners[2].name,
        Cell: ({ row }) => <OwnersBarCodeCell row={row} ownerRow={2} />,
      },
      {
        id: `owner${owners[3].name}`,
        accessorKey: 'owner',
        header: owners[3].name,
        Cell: ({ row }) => <OwnersBarCodeCell row={row} ownerRow={3} />,
      },
    ],
    [mutations, publications, t]
  )

Here is rendered component for Cell:

const OwnersBarCodeCell: FC<{
  row: MRT_Row<TSpecimen>
  ownerRow: 0 | 1 | 2 | 3
}> = ({ row, ownerRow }) => {
  const { classes } = useStyles()
  const { t, i18n } = useTranslation()

  return Number(row.original.owner) === owners[ownerRow].id ? (
    <Flex
      sx={(theme) => ({
        gap: theme.spacing.xs,
        alignItems: 'center',
        justifyContent: 'center',
      })}
    >
      {row.original.barCode}
      <Link
        className={classes.link}
        to={`/${i18n.resolvedLanguage}/${t('urls.volume_overview')}/${
          row.original.barCode
        }`}
      >
        <IconFileSymlink size={20} />
      </Link>
      {getSpecimenState(row.original)}
    </Flex>
  ) : undefined
}

Here is ESlint config:

module.exports = {
  settings: {
    react: {
      version: 'detect',
    },
  },
  env: {
    browser: true,
    es2022: true,
  },
  extends: [
    'airbnb',
    'airbnb-typescript',
    'airbnb/hooks',
    'plugin:react/recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:prettier/recommended',
  ],
  overrides: [],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
    project: ['./tsconfig.json'],
    tsconfigRootDir: __dirname,
  },
  ignorePatterns: ['vite.config.ts', 'vitest.config.ts'],
  plugins: ['react', '@typescript-eslint', 'prettier'],
  rules: {
    'react/react-in-jsx-scope': 0,
    'react/function-component-definition': 0,
    'react/require-default-props': ['error', { functions: 'defaultArguments' }],
    'prettier/prettier': 'error',
    'import/no-extraneous-dependencies': 0,
    'no-continue': 0,
    '@typescript-eslint/no-unused-vars': 1,
    'react/no-unstable-nested-components': [
      'error',
      {
        allowAsProps: true,
      },
    ],
  },
}

Minimal, Reproducible Example - (Optional, but Recommended)

Described above

Screenshots or Videos (Optional)

obrazek obrazek

Do you intend to try to help solve this bug with your own PR?

None

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.

Full Simple Example in NextJS 13 throws an error

mantine-react-table version

6.05

react & react-dom versions

v18

Describe the bug and the steps to reproduce it

Trying to learn the project using Mantine with NextJS 13 using the app directory structure ( I understand this is not fully supported yet, but it works without react-table): https://www.mantine-react-table.com/docs/getting-started/usage#full-simple-example

Minimal, Reproducible Example - (Optional, but Recommended)

My package.json

{
  "name": "ia-mantine",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@emotion/react": "^11.10.6",
    "@emotion/server": "^11.10.0",
    "@mantine/core": "^6.0.5",
    "@mantine/hooks": "^6.0.5",
    "@mantine/next": "^6.0.5",
    "@types/node": "18.15.11",
    "@types/react": "18.0.31",
    "@types/react-dom": "18.0.11",
    "eslint": "8.37.0",
    "eslint-config-next": "13.2.4",
    "mantine-react-table": "^1.0.0-beta.0",
    "next": "13.2.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "typescript": "5.0.2"
  }
}

my test-component.tsx:

'use client';

import React, { useMemo } from 'react';
import { MantineReactTable } from 'mantine-react-table';
import type { MRT_ColumnDef } from 'mantine-react-table'; // If using TypeScript (optional, but recommended)

//If using TypeScript, define the shape of your data (optional, but recommended)
interface Person {
  name: string;
  age: number;
}

//mock data - strongly typed if you are using TypeScript (optional, but recommended)
const data: Person[] = [
  {
    name: 'John',
    age: 30,
  },
  {
    name: 'Sara',
    age: 25,
  },
];

export function Test() {
  //column definitions - strongly typed if you are using TypeScript (optional, but recommended)
  const columns = useMemo<MRT_ColumnDef<Person>[]>(
    () => [
      {
        accessorKey: 'name', //simple recommended way to define a column
        header: 'Name',
        mantineTableHeadCellProps: { sx: { color: 'green' } }, //custom props
      },
      {
        accessorFn: (originalRow) => originalRow.age, //alternate way
        id: 'age', //id required if you use accessorFn instead of accessorKey
        header: 'Age',
        Header: <i style={{ color: 'red' }}>Age</i>, //optional custom markup
      },
    ],
    [],
  );

  return (
    <MantineReactTable
      columns={columns}
      data={data}
      enableRowSelection //enable some features
      enableColumnOrdering
      enableGlobalFilter={false} //turn off a feature
    />
  );
}

my page.tsx:

import { Test } from './test-component';

export default function Page() {
  return <Test />;
}

my layout.tsx:

import RootStyleRegistry from './emotion';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en-US">
      <head />
      <body>
        <RootStyleRegistry>{children}</RootStyleRegistry>
      </body>
    </html>
  );
}

emotion.tsx:

'use client';

import { CacheProvider } from '@emotion/react';
import { useEmotionCache, MantineProvider } from '@mantine/core';
import { useServerInsertedHTML } from 'next/navigation';

export default function RootStyleRegistry({ children }: { children: React.ReactNode }) {
  const cache = useEmotionCache();
  cache.compat = true;

  useServerInsertedHTML(() => (
    <style
      data-emotion={`${cache.key} ${Object.keys(cache.inserted).join(' ')}`}
      dangerouslySetInnerHTML={{
        __html: Object.values(cache.inserted).join(' '),
      }}
    />
  ));

  return (
    <CacheProvider value={cache}>
      <MantineProvider withGlobalStyles withNormalizeCSS>
        {children}
      </MantineProvider>
    </CacheProvider>
  );
}

error:

Warning: Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.
MRT_TableRoot@webpack-internal:///(app-client)/./node_modules/mantine-react-table/dist/esm/mantine-react-table.esm.js:2685:75
MantineReactTable@webpack-internal:///(app-client)/./node_modules/mantine-react-table/dist/esm/mantine-react-table.esm.js:2954:1249
Test@webpack-internal:///(app-client)/./src/app/test-component.tsx:27:67
ScrollAndFocusHandler@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:153:1
InnerLayoutRouter@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:196:44
RedirectErrorBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:361:9
RedirectBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:368:25
NotFoundErrorBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:397:9
NotFoundBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:404:53
LoadingBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:317:64
ErrorBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/error-boundary.js:72:56
RenderFromTemplateContext@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/render-from-template-context.js:12:34
OuterLayoutRouter@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/layout-router.js:23:177
ThemeProvider@webpack-internal:///(app-client)/./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js:96:64
MantineProvider@webpack-internal:///(app-client)/./node_modules/@mantine/styles/esm/theme/MantineProvider.js:78:25
RootStyleRegistry@webpack-internal:///(app-client)/./src/app/emotion.tsx:17:25
body
html
ReactDevOverlay@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/react-dev-overlay/internal/ReactDevOverlay.js:61:9
HotReload@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/react-dev-overlay/hot-reloader-client.js:20:39
Router@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/app-router.js:48:89
ErrorBoundaryHandler@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/error-boundary.js:59:9
ErrorBoundary@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/error-boundary.js:72:56
AppRouter@webpack-internal:///(app-client)/./node_modules/next/dist/client/components/app-router.js:24:39
ServerRoot@webpack-internal:///(app-client)/./node_modules/next/dist/client/app-index.js:147:25
RSCComponent
Root@webpack-internal:///(app-client)/./node_modules/next/dist/client/app-index.js:164:25 [hydration-error-info.js:27:13](webpack://_N_E/node_modules/next/dist/client/components/react-dev-overlay/internal/helpers/hydration-error-info.js?32aa)
    error hydration-error-info.js:27
    printWarning react-dom.development.js:94
    error react-dom.development.js:68
    warnAboutUpdateOnNotYetMountedFiberInDEV react-dom.development.js:32016
    detectUpdateOnUnmountedFiber react-dom.development.js:14949
    getRootForUpdatedFiber react-dom.development.js:14936
    enqueueConcurrentHookUpdate react-dom.development.js:14814
    dispatchSetState react-dom.development.js:18894
    onStateChange index.mjs:63
    setState index.mjs:2665
    makeStateUpdater index.mjs:25
    setPagination index.mjs:1541
    setPageIndex index.mjs:1548
    resetPageIndex index.mjs:1560
    _autoResetPageIndex index.mjs:1531
    _queue index.mjs:2646
    (Async: promise callback)
    _queue index.mjs:2644
    _autoResetPageIndex index.mjs:1530
    onChange index.mjs:3213
    memo index.mjs:65
    getFilteredRowModel index.mjs:1191
    getPreGroupedRowModel index.mjs:1393
    getGroupedRowModel index.mjs:3394
    memo index.mjs:56
    getGroupedRowModel index.mjs:1401
    getPreSortedRowModel index.mjs:2479
    getSortedRowModel index.mjs:3309
    memo index.mjs:56
    getSortedRowModel index.mjs:2487
    getPreExpandedRowModel index.mjs:859
    getExpandedRowModel index.mjs:3536
    memo index.mjs:56
    getExpandedRowModel index.mjs:867
    getPrePaginationRowModel index.mjs:1624
    getPaginationRowModel index.mjs:3571
    memo index.mjs:56
    getPaginationRowModel index.mjs:1632
    getRowModel index.mjs:2681
    MRT_Table mantine-react-table.esm.js:2446
    renderWithHooks react-dom.development.js:17498
    mountIndeterminateComponent react-dom.development.js:22553
    beginWork$1 react-dom.development.js:24128
    beginWork react-dom.development.js:32040
    performUnitOfWork react-dom.development.js:30938
    workLoopConcurrent react-dom.development.js:30924
    renderRootConcurrent react-dom.development.js:30880
    performConcurrentWorkOnRoot react-dom.development.js:29836
    workLoop index.js:10
    flushWork index.js:10
    performWorkUntilDeadline index.js:10
    (Async: EventHandlerNonNull)
    853 index.js:10
    853 index.js:10
    __nccwpck_require__ index.js:19
    833 index.js:19
    __nccwpck_require__ index.js:19
    <anonymous> index.js:19
    <anonymous> index.js:19
    NextJS 4
    <anonymous> react-dom.development.js:27
    <anonymous> react-dom.development.js:34563
    NextJS 4
    <anonymous> index.js:37
    NextJS 4
    <anonymous> client.js:3
    NextJS 4
    <anonymous> app-index.js:10
    NextJS 4
    <anonymous> app-next-dev.js:5
    appBootstrap app-bootstrap.js:52
    loadScriptsInSequence app-bootstrap.js:18
    appBootstrap app-bootstrap.js:51
    <anonymous> app-next-dev.js:4
    NextJS 7

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

Pinned column overlap in safari

mantine-react-table version

1.0.0-beta.3

react & react-dom versions

react: v17.0.42, react-dom: v18.0.4

Describe the bug and the steps to reproduce it

Initially brought up this issue in discord but did not get any responses so wanted to increase it's visibility.

When pinning the leftmost column, on Safari the upper left row header cell gets overlapped rows within the table. I have tried debugging this a few times but am not sure why this is occurring. This is ONLY present on Safari, the table acted as expected in Chrome & Firefox

Minimal, Reproducible Example - (Optional, but Recommended)

I have 2 examples

  1. Open this example in safari
  2. Enable full screen mode
  3. Condense screen size vertically so the table is scrollable
  4. Scroll, the bug will be present

Or by running this small code snippet example

import { MantineReactTable, MRT_ColumnDef } from 'mantine-react-table';
import { useMemo } from 'react';

const BrokenTable = () => {
  type Person = {
    name: {
      firstName: string;
      lastName: string;
    };
    address: string;
    city: string;
    state: string;
  };

  const person_data: Person[] = [
    {
      name: {
        firstName: 'Zachary',
        lastName: 'Davis',
      },
      address: '261 Battle Ford',
      city: 'Columbus',
      state: 'Ohio',
    },
    {
      name: {
        firstName: 'Robert',
        lastName: 'Smith',
      },
      address: '566 Brakus Inlet',
      city: 'Westerville',
      state: 'West Virginia',
    },
    {
      name: {
        firstName: 'Kevin',
        lastName: 'Yan',
      },
      address: '7777 Kuhic Knoll',
      city: 'South Linda',
      state: 'West Virginia',
    },
    {
      name: {
        firstName: 'John',
        lastName: 'Upton',
      },
      address: '722 Emie Stream',
      city: 'Huntington',
      state: 'Washington',
    },
  ];

  const table_columns = useMemo<MRT_ColumnDef<Person>[]>(
    () => [
      {
        accessorKey: 'name.firstName',
        header: 'First Name',
      },
      {
        accessorKey: 'name.lastName',
        header: 'Last Name',
      },
      {
        accessorKey: 'address',
        header: 'Address',
      },
      {
        accessorKey: 'city',
        header: 'City',
      },
      {
        accessorKey: 'state',
        header: 'State',
      },
    ],
    []
  );

  return (
    <MantineReactTable
      enableStickyHeader={true}
      initialState={{
        columnPinning: { left: ['name.firstName'] },
      }}
      columns={table_columns}
      data={person_data}
      enablePagination={false}
      mantineTableContainerProps={{ sx: { maxHeight: '200px' } }}
    />
  );
};

export default BrokenTable;

Screenshots or Videos (Optional)

What it looks like in safari
safari

What it looks like in chrome or firefox
chrome

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.

Default column filter mode may become undefined

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Default column filter mode may become undefined. It still looks like working as fuzzy, but it shows undefined in filter header label and tooltips.

I have no 100% working steps and minimal example.
I haven't found it in examples on official website. And I tried to find any clues when it starts to happen.
And in my local setup it started to reproduce even in bare minimum setup.
First time I thought it happen only with next js devserver and only after HMR applied.
Once I did next build and next start problem dissapeared.
Soon it started to happen without HMR and later on my next build / next start without any additional manipulations.

Minimal, Reproducible Example - (Optional, but Recommended)

Simple to demonstrate use case:
https://stackblitz.com/github/KevinVandy/mantine-react-table/tree/main/apps/mantine-react-table-docs/examples/customize-filter-modes/sandbox?file=src/TS.tsx

  • make any change in source files and save
  • wait for HMR happen
  • see that filter mode for column became undefined

Again. In my local setup I have this 100% of time unless I manually select some mode from dropdown explicitly. Even with simplest setup possible, production build and without HMR happened.

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Selection + Action columns not displayed right, when displayed together

mantine-react-table version

v1.0.0-beta

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

When displaying row selection as well as row actions, the selection column as well as the action column grow in size, when they shouldn't. The checkboxes also don't have a pointer as cursor.

How to reproduce:
Set the following props:

  enableRowSelection
  enableRowActions
  positionActionsColumn="last"
  renderRowActions={(rowActionProps) => {
    const { row } = rowActionProps;

    return <div>row.original</div>;
  }}

Minimal, Reproducible Example - (Optional, but Recommended)

Add the props to the following example:
https://stackblitz.com/github/KevinVandy/mantine-react-table/tree/main/apps/mantine-react-table-docs/examples/enable-row-selection/sandbox?file=src%2FTS.tsx

Screenshots or Videos (Optional)

Screenshot 2023-03-31 at 12 27 00

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

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.

Cannot use date-range filterVariant

mantine-react-table version

v0.9.3

react & react-dom versions

v17.0.2 & v17.0.1

Describe the bug and the steps to reproduce it

Awesome work! This is a fantastic plugin and I'm super thankful to have found this.

Just wrestling with date-range filtering, setting filterVariant to date-range does not show a date range picker for filtering by date ranges as the docs suggest, but rather shows the default TextInput component.

Even with manually defining the DatePicker component for both Filter and Filter2 in the column definition, the DatePicker components display correctly but do not filter correctly, even when manually calling column.setFilterValue(newValue) on the onChange props (respectively).

Minimal, Reproducible Example

https://codesandbox.io/p/sandbox/zen-bhabha-9fz4hy?file=%2Fsrc%2FTS.tsx

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.

'"mantine-react-table"' has no exported member named 'useMantineReactTable'

mantine-react-table version

1.2.0

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

useMantineReactTable does not seem to be exported.

'"mantine-react-table"' has no exported member named 'useMantineReactTable'. Did you mean 'MantineReactTable'?

Minimal, Reproducible Example - (Optional, but Recommended)

  1. yarn add @mantine/core @mantine/hooks @mantine/dates @tabler/icons-react @emotion/react dayjs react react-dom mantine-react-table

  2. Write a module:

    import {
      MantineReactTable,
      useMantineReactTable,
    } from 'mantine-react-table';

Screenshots or Videos (Optional)

image

Do you intend to try to help solve this bug with your own PR?

None

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.

Freeze when updating data and changing sorting

mantine-react-table version

1.0.0-beta.7

react & react-dom versions

18.2

Describe the bug and the steps to reproduce it

I have modified example: https://www.mantine-react-table.com/docs/examples/data-export#data-export-example
on stackblitz https://stackblitz.com/edit/github-jx1fhb?file=src%2FTS.tsx

It is fake data generator/modifier using useEffect.
In real app, I have context datamanager, which handles data update and it is trigered every 1 second.
In "@mui/x-data-grid": "^5" it works as expected.

Steps to reproduce:

  1. run example
  2. start quickly clicking on either column sort indicator. It will freeze ( tested in chrome/firefox ) Maybe filtering would also freeze app, but sorting can be triggeed quickly to find out.

Maybe this is not correct way to update data, but I did not find way to do it other way. I am using react property system, to handle updates. In c++ frameworks there were oftern methods like beforeUpdate and afterUpdate when calling own data update. But I did not find these so I assumed that it property changes are ok.

Minimal, Reproducible Example - (Optional, but Recommended)

https://stackblitz.com/edit/github-jx1fhb?file=src%2FTS.tsx

Screenshots or Videos (Optional)

No response

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.

french translation error

mantine-react-table version

V6.0.21

react & react-dom versions

V18.2.0

Describe the bug and the steps to reproduce it

5 de 5 ligne(s) is wrong translation in french.

We can say 5 sur 5 ligne(s).

Minimal, Reproducible Example - (Optional, but Recommended)

You can add an key for this in the local file for fix.

The other uses of key "of" are correct.

Screenshots or Videos (Optional)

Capture d’écran du 2023-09-19 10-45-40

Do you intend to try to help solve this bug with your own PR?

No, because I do not have time to dig into it

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.

onCreatingRowChange is never called

mantine-react-table version

1.3.1

react & react-dom versions

18.2

Describe the bug and the steps to reproduce it

Created from discussion #155

onEditingRowChange works perfectly, but onCreatingRowChange is never called

Minimal, Reproducible Example - (Optional, but Recommended)

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

None

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.

[BUG] Row action menu items not shown if initial state has `columnOrder`

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

If we set columnOrder in initialState, then action menu is not rendered.

Minimal, Reproducible Example - (Optional, but Recommended)

return (
        <MantineReactTable
            data={records.data}
            columns={columns}
            enableRowActions
            renderRowActionMenuItems={({ row }) => (
                <Box component={Stack}>
                    <Button onClick={() => actionHandler(row, 'edit')}>
                        Edit
                    </Button>
                    <Button onClick={() => actionHandler(row, 'run')}>
                        Run
                    </Button>
                    <Button onClick={() => actionHandler(row, 'cancel')}>
                        Cancel
                    </Button>
                </Box>
            )}
            initialState={{
                // columnOrder: [
                //     'id',
                //     'type',
                //     'description',
                //     'active',
                //     'lastrun_at',
                //     'actions',
                // ],
            }}
        />
    );

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

renderColumnActionsMenuItems doesnt override the whole menu

mantine-react-table version

v0.9.5

react & react-dom versions

v18.2.0

Describe the bug and the steps to reproduce it

Column Actions Menu is not completely overrided by renderColumnActionsMenuItems. It seems to only replace sorting menu. From what I understand it meant to replace the whole menu content.

Here some screenshots, where I tried to use it

Action menu:
Screenshot 2023-05-02 at 20 20 59

Action menu, where I try to use renderColumnActionsMenuItems
Screenshot 2023-05-02 at 20 27 20

Let me know that you think. I'll open a PR about it soon

PS: You library is really great. Thanks for your hard work :)

Screenshots or Videos (Optional)

No response

Do you intend to try to help solve this bug with your own PR?

Yes, I am also opening a PR that solves the problem along side this issue

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.

Column with null values causes crashes with some filter modes

mantine-react-table version

1.0.0-beta.2

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

Data set with string column but it may contain null values.
Define column with just accessorKey.
enableColumnFilters and enableColumnFilterModes on table.
Try to enable filter other than fuzzy on column with null values.

Minimal, Reproducible Example - (Optional, but Recommended)

const rows = [
  { id: 1, office: 'Present' },
  { id: 2, office: null },
]

const columns = [
  {
    header: 'Office',
    accessorKey: 'office',
  }
]

<MantineReactTable
  coluns={columns}
  rows={rows}
  enableColumnFilters
  enableColumnFilterModes
/>

Screenshots or Videos (Optional)

Unhandled Runtime Error
TypeError: Cannot read properties of null (reading 'toString')

Call Stack
Object.equals [as filterFn]
node_modules/mantine-react-table/dist/esm/mantine-react-table.esm.js (266:0)
memo.key
node_modules/@tanstack/table-core/build/lib/index.mjs (3173:0)
Object.eval [as _getFilteredRowModel]
node_modules/@tanstack/table-core/build/lib/index.mjs (64:0)
Object.getFilteredRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (1193:0)
Object.getPreGroupedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (1395:0)
eval
node_modules/@tanstack/table-core/build/lib/index.mjs (3395:0)
Object.eval [as _getGroupedRowModel]
node_modules/@tanstack/table-core/build/lib/index.mjs (56:0)
Object.getGroupedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (1403:0)
Object.getPreSortedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (2481:0)
eval
node_modules/@tanstack/table-core/build/lib/index.mjs (3310:0)
Object.eval [as _getSortedRowModel]
node_modules/@tanstack/table-core/build/lib/index.mjs (56:0)
Object.getSortedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (2489:0)
Object.getPreExpandedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (861:0)
eval
node_modules/@tanstack/table-core/build/lib/index.mjs (3537:0)
Object.eval [as _getExpandedRowModel]
node_modules/@tanstack/table-core/build/lib/index.mjs (56:0)
Object.getExpandedRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (869:0)
Object.getPrePaginationRowModel
node_modules/@tanstack/table-core/build/lib/index.mjs (1626:0)
MRT_TableRoot
node_modules/mantine-react-table/dist/esm/mantine-react-table.esm.js (2809:5)
renderWithHooks
node_modules/react-dom/cjs/react-dom.development.js (16305:0)
updateFunctionComponent
node_modules/react-dom/cjs/react-dom.development.js (19588:0)
beginWork
node_modules/react-dom/cjs/react-dom.development.js (21601:0)
HTMLUnknownElement.callCallback
node_modules/react-dom/cjs/react-dom.development.js (4164:0)
Object.invokeGuardedCallbackDev
node_modules/react-dom/cjs/react-dom.development.js (4213:0)
invokeGuardedCallback
node_modules/react-dom/cjs/react-dom.development.js (4277:0)
beginWork$1
node_modules/react-dom/cjs/react-dom.development.js (27451:0)
performUnitOfWork
node_modules/react-dom/cjs/react-dom.development.js (26557:0)
workLoopSync
node_modules/react-dom/cjs/react-dom.development.js (26466:0)
renderRootSync
node_modules/react-dom/cjs/react-dom.development.js (26434:0)
performSyncWorkOnRoot
node_modules/react-dom/cjs/react-dom.development.js (26085:0)
flushSyncCallbacks
node_modules/react-dom/cjs/react-dom.development.js (12042:0)
eval
node_modules/react-dom/cjs/react-dom.development.js (25651:0)

Do you intend to try to help solve this bug with your own PR?

Maybe, I'll investigate and start debugging

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.