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

References isSorted and isSortedDesc never changes when a column is provided under hiddenColumns #3635

Closed
aravindtrue opened this issue Jan 13, 2022 · 3 comments
Labels

Comments

@aravindtrue
Copy link

Describe the bug (required)

  1. I would like to hide a column, and table header for all the columns
  2. I still want to use sort feature in a different way i.e., I will place the sort option right above the table where user can click to change the order of the list view
  3. In this case, Global search and Filter above the table are working as expected where the sorting is not. isSorted and isSortedDesc never changes when I click the sort for the hidden column

Provide an example via Codesandbox! (required)
react-table codesandbox to reproduce the issue.

Steps To Reproduce (required)

  1. Click Device Usage, you will see an arrow appears and changes up/down.
  2. Click Memory, you will see an arrow appears and changes up/down.
  3. When you click Name, you will NOT see the same behavior but the list view still orders in the asc order

Expected behavior (Recommended)
Arrow should appear when Name is clicked i.e., isSorted and isSortedDesc must change when clicking the sort option for the hidden column

Desktop (please complete the following information):

  • OS: MacOS BigSur 11.6
  • Browser Chrome
  • Version 96.0
@Go1dExperience
Copy link

Go1dExperience commented Feb 4, 2022

I don't think this is a possible situation. For the sorting icons to appear, the isVisible must be true, that's the short answer. The long answer is the column must exist in flatHeaders, which depends on headerGroups array. And for a column to be in headerGroups, it must have isVisible = true. If you go to https://github.com/TanStack/react-table/blob/76a4a861ee56b782404ef91987c3b5691ecf2ebc/src/hooks/useTable.js#L364-L369 and change the 2 return statements to true, you will get the result you want. I wouldn't consider this a bug.

@github-actions
Copy link

github-actions bot commented Apr 8, 2022

This issue is being marked as stale (no activity in the last 14 days)

@github-actions github-actions bot added the Stale label Apr 8, 2022
@github-actions
Copy link

github-actions bot commented Apr 8, 2022

This issue has been detected as stale and automatically closed. It's very likely that your issue has remained here this long because it would require breaking changes to v7. React Table v8 is currently in alpha (soon beta!) and already contains bug fixes, performance improvements and architectural changes that likely address this issue.

  • If your v7 issue has been previously labeled as requiring breaking changes, please try the new v8 alpha/beta releases
  • If your v7 issue has not already been labeled as a breaking change, open a new issue.
  • If this was a v8 issue and was closed by mistake, please reopen or leave a comment below.

@github-actions github-actions bot closed this as completed Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants