Skip to content

Commit

Permalink
fix using Gruped Headers and virtualization together
Browse files Browse the repository at this point in the history
  • Loading branch information
giogonzo committed Sep 22, 2023
1 parent 95f4d0d commit df93c63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/bento-design-system/src/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export function Table<
}

const renderedRows = virtualizeRows
? columns
? flatColumns
.map((_, index) => (
<div key={`paddingTop${index}`} style={{ marginTop: virtualPaddingTop }} />
))
Expand All @@ -403,7 +403,7 @@ export function Table<
})
)
.concat(
columns.map((_, index) => (
flatColumns.map((_, index) => (
<div key={`paddingBottom${index}`} style={{ marginBottom: virtualPaddingBottom }} />
))
)
Expand Down
10 changes: 10 additions & 0 deletions packages/bento-design-system/stories/Components/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,3 +577,13 @@ export const VirtualizedRows = {
data: repeatToLength(exampleData, 1_000),
},
} satisfies Story;

export const VirtualizedRowsGrupedHeaders = {
args: {
columns: exampleGroupedColumns,
stickyHeaders: true,
height: { custom: 340 },
virtualizeRows: true,
data: repeatToLength(exampleData, 1_000),
},
} satisfies Story;

0 comments on commit df93c63

Please sign in to comment.