Skip to content

Commit

Permalink
fix(table): add empty content only when table size is 0 #2742 (#2747)
Browse files Browse the repository at this point in the history
* fix(table): add empty content only when table size is 0 #2742

* fix(table): added changeset

---------

Co-authored-by: shrinidhi.upadhyaya <shrinidhi.upadhyaya@stud.uni-bamberg.de>
  • Loading branch information
ShrinidhiUpadhyaya and shrinidhi.upadhyaya committed Apr 17, 2024
1 parent cadbb30 commit 2126ea1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/lazy-pears-turn.md
@@ -0,0 +1,5 @@
---
"@nextui-org/table": patch
---

Fixes adding of empty content at the bottom of the table when rows present in Table (#2742)
4 changes: 3 additions & 1 deletion packages/components/table/src/table-body.tsx
Expand Up @@ -121,7 +121,9 @@ const TableBody = forwardRef<"tbody", TableBodyProps>((props, ref) => {
>
{bodyProps.loadingContent}
</td>
{!emptyContent && <td className={slots?.emptyWrapper({class: classNames?.emptyWrapper})} />}
{!emptyContent && collection.size === 0 ? (
<td className={slots?.emptyWrapper({class: classNames?.emptyWrapper})} />
) : null}
</tr>
);
}
Expand Down

0 comments on commit 2126ea1

Please sign in to comment.