Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nine-carrots-pay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@heroui/table": patch
---

remove `removeWrapper` from virtualized table (#4995)
3 changes: 2 additions & 1 deletion apps/docs/content/docs/components/table.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ In case you don't want to render the header, you can use the `hideHeader` prop.

By default the table is wrapped in a `div` element with a small shadow effect and a border radius.
You can use the `removeWrapper` prop to remove the wrapper and only render the table.
However, the `removeWrapper` prop has no effect on a virtualized table, as the wrapper is required to manage its height.

<CodeDemo title="Without Wrapper" files={tableContent.withoutWrapper} />

Expand Down Expand Up @@ -538,7 +539,7 @@ You can customize the `Table` component by passing custom Tailwind CSS classes t
{
attribute: "removeWrapper",
type: "boolean",
description: "Whether the table base container should not be rendered.",
description: "Whether the base container should not be rendered for a non-virtualized table.",
default: "false"
},
{
Expand Down
7 changes: 1 addition & 6 deletions packages/components/table/src/virtualized-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const VirtualizedTable = forwardRef<"table", TableProps>((props, ref) => {
topContentPlacement,
bottomContentPlacement,
bottomContent,
removeWrapper,
getBaseProps,
getWrapperProps,
getTableProps,
Expand All @@ -42,10 +41,6 @@ const VirtualizedTable = forwardRef<"table", TableProps>((props, ref) => {

const Wrapper = useCallback(
({children}: {children: JSX.Element}) => {
if (removeWrapper) {
return children;
}

return (
<BaseComponent
{...getWrapperProps()}
Expand All @@ -57,7 +52,7 @@ const VirtualizedTable = forwardRef<"table", TableProps>((props, ref) => {
</BaseComponent>
);
},
[removeWrapper, getWrapperProps, maxTableHeight],
[getWrapperProps, maxTableHeight],
);

const items = [...collection.body.childNodes];
Expand Down