Skip to content

Commit

Permalink
Fix empty insertion in horizontal headers
Browse files Browse the repository at this point in the history
Refs: #6890
  • Loading branch information
anicyne committed Nov 21, 2024
1 parent 56fd05c commit f5f4839
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
17 changes: 8 additions & 9 deletions packages/components/src/components/table-stateless/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,15 @@ export class KolTableStateless implements TableStatelessAPI {
headers.vertical.forEach((_row, index) => {
rowCount[index] = 0;
rowSpans[index] = [];
Array.isArray(headers.horizontal) &&
headers.horizontal.forEach((row) => {
row.unshift({
label: '',
asTd: true,
colSpan: 1,
rowSpan: 1,
});
});
});
if (Array.isArray(headers.vertical) && headers.vertical.length > 0 && Array.isArray(headers.horizontal) && headers.horizontal[0][0]?.label !== '') {
headers.horizontal[0].unshift({
label: '',
asTd: true,
colSpan: 1,
rowSpan: 1,
});
}

for (let i = startRow; i < maxRows; i++) {
const dataRow: KoliBriTableHeaderCellWithLogic[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export const InteractiveChildElements: FC = () => (
_headerCells={{
horizontal: [
[
{ label: '', asTd: true, width: '20ex' },
getButtonHeaderCell('primary'),
getButtonHeaderCell('secondary'),
getButtonHeaderCell('normal'),
Expand Down

0 comments on commit f5f4839

Please sign in to comment.