Skip to content

Commit

Permalink
fix(table-core): column getCanGroup always resolving to true (#4843)
Browse files Browse the repository at this point in the history
* Fix getCanGroup always resolving to true

* fix column.getCanGroup

---------

Co-authored-by: Phil Morris <phil@residently.com>
Co-authored-by: Kevin Van Cott <kevinvandy656@gmail.com>
  • Loading branch information
3 people committed Mar 29, 2024
1 parent c6b2507 commit fce4725
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/table-core/src/features/ColumnGrouping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,9 @@ export const ColumnGrouping: TableFeature = {

column.getCanGroup = () => {
return (
column.columnDef.enableGrouping ??
true ??
table.options.enableGrouping ??
true ??
!!column.accessorFn
(column.columnDef.enableGrouping ?? true) &&
(table.options.enableGrouping ?? true) &&
(!!column.accessorFn || !!column.columnDef.getGroupingValue)
)
}

Expand Down

0 comments on commit fce4725

Please sign in to comment.