Skip to content

Commit

Permalink
Merge pull request #5817 from matuzalemsteles/clay-table-fix-bug
Browse files Browse the repository at this point in the history
fix(@clayui/core): fixes bug when not rendering the action cell
  • Loading branch information
matuzalemsteles authored May 16, 2024
2 parents 5b42133 + 5f6eec5 commit be6beba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/clay-core/src/table/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,16 @@ function RowInner<T extends Record<string, any>>(

const ref = useForwardRef(outRef);

const visibleKeys = useMemo(
() => Array.from(visibleColumns.values()),
[visibleColumns]
);
const visibleKeys = useMemo(() => {
const count = React.Children.count(children);

return [
...Array.from(visibleColumns.values()),
...(columnsVisibility && count > visibleColumns.size
? [count - 1]
: []),
];
}, [columnsVisibility, visibleColumns]);

const collection = useCollection({
children,
Expand Down

0 comments on commit be6beba

Please sign in to comment.