icflorescu / mantine-datatable

The table component for your Mantine data-rich applications, supporting asynchronous data loading, column sorting, custom cell data rendering, context menus, nesting, Gmail-style batch row selection, dark theme, and more.
https://icflorescu.github.io/mantine-datatable/
MIT License
911 stars 66 forks source link

hidden prop on columns doesn't work #627

Closed KuriatoV closed 3 weeks ago

KuriatoV commented 1 month ago

Seems like prop "hidden" on column doesn't affect the column and depends only on "toggled" prop, this caused by this code in useDataTableColumns.ts

 const result = columnsOrder
      .map((order) => columns.find((column) => column.accessor === order))
      .map((column) => {
        return {
          ...column,
          hidden: !columnsToggle.find((toggle) => {          // here 
            return toggle.accessor === column?.accessor;
          })?.toggled,
        };
      }) as DataTableColumn<T>[];