You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using column helpers to create a column group, consumers are able to provide enableHiding: true as a column def option. However:
column.getToggleVisibilityHandler() or column.toggleVisibility always updates the table's columnVisibility state to have a false entry for that column group's id
column.getIsVisible() always returns true for that column group
Ideally, the getToggleVisibilityHandler, toggleVisibility, getIsVisible, and related HeaderGroup APIs could all be updated to support visibility toggling on column groups (which in turn would show or hide the children columns of that column group). Worst case, if toggling visibility of groups isn't something that can be supported, the enableHiding column def option could be removed from the column helpers API so it's not misleading to consumers.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
This video uses the linked Code Sandbox example which is almost identical to the example in the documentation, but instead of rendering the column leaves as visibility checkbox options it renders the column groups as options. When interacting with the checkbox options which should toggle the column visibility, the visibility state is always set to false and the checkbox is always checked.
Screen.Recording.2024-04-18.at.3.43.36.PM.mov
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
I agree to follow this project's Code of Conduct
I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
TanStack Table version
v8.15.2
Framework/Library version
React v8.15.2
Describe the bug and the steps to reproduce it
When using column helpers to create a column group, consumers are able to provide
enableHiding: true
as a column def option. However:column.getToggleVisibilityHandler()
orcolumn.toggleVisibility
always updates the table'scolumnVisibility
state to have afalse
entry for that column group's idcolumn.getIsVisible()
always returnstrue
for that column groupIdeally, the
getToggleVisibilityHandler
,toggleVisibility
,getIsVisible
, and relatedHeaderGroup
APIs could all be updated to support visibility toggling on column groups (which in turn would show or hide the children columns of that column group). Worst case, if toggling visibility of groups isn't something that can be supported, theenableHiding
column def option could be removed from the column helpers API so it's not misleading to consumers.Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/devbox/dry-river-9t7pg9
Screenshots or Videos (Optional)
This video uses the linked Code Sandbox example which is almost identical to the example in the documentation, but instead of rendering the column leaves as visibility checkbox options it renders the column groups as options. When interacting with the checkbox options which should toggle the column visibility, the visibility state is always set to
false
and the checkbox is always checked.Screen.Recording.2024-04-18.at.3.43.36.PM.mov
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
The text was updated successfully, but these errors were encountered: