Skip to content

Commit 512fc79

Browse files
committed
fix: Fix failing unit tests for row count and single row render condition
1 parent 0ffe437 commit 512fc79

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/table/internal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ const InternalTable = React.forwardRef(
498498

499499
const colIndexOffset = selectionType ? 1 : 0;
500500
const totalColumnsCount = visibleColumnDefinitions.length + colIndexOffset;
501-
const headerRowCount = hierarchicalStructure?.rows.length ?? 1;
501+
const headerRowCount = hierarchicalStructure?.rows.length || 1;
502502

503503
return (
504504
<LinkDefaultVariantContext.Provider value={{ defaultVariant: 'primary' }}>

src/table/thead.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const Thead = React.forwardRef(
142142
};
143143

144144
// No grouping - render single row
145-
if (!hierarchicalStructure || hierarchicalStructure.rows.length === 1) {
145+
if (!hierarchicalStructure || hierarchicalStructure.rows.length <= 1) {
146146
return (
147147
<thead className={clsx(!hidden && styles['thead-active'])}>
148148
<tr

0 commit comments

Comments
 (0)