mantine-react-table icon indicating copy to clipboard operation
mantine-react-table copied to clipboard

visibleInShowHideMenu: false has no effect on "Show all columns"

Open matttk opened this issue 1 year ago • 0 comments

mantine-react-table version

2.0.0-beta.6

react & react-dom versions

18.2.0

Describe the bug and the steps to reproduce it

  1. Disable a column from the show/hide menu via visibleInShowHideMenu: false.
  2. Set the column to default hidden with columnVisibility in initialState. (not necessar but easier to reproduce with this step)
  3. Click "Show all columns"

All columns appear, including the one that is not visible in the show/hide menu.

I would expect the disabled column (in the stackblitz example below, I chose name.firstName) to remain hidden, as the user cannot turn it back off, except by clicking "hide all".

As a background to why I am using this option, I want to sort the table by creation date but not show creation date to the user. If I disable sorting for creation date, the table can't be sorted by that column, so I have the column always hidden in the background, with no ability to show it. This works perfectly, until you click "show all".

Minimal, Reproducible Example - (Optional, but Recommended)

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

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

  • [X] 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.

matttk avatar Aug 12 '24 14:08 matttk