From 5f6eec58859d9153a19a92cddcee0d8cc5a2c9fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matuzal=C3=A9m=20Teles?= Date: Tue, 14 May 2024 16:38:18 -0500 Subject: [PATCH] fix(@clayui/core): fixes bug when not rendering the action cell --- packages/clay-core/src/table/Row.tsx | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/clay-core/src/table/Row.tsx b/packages/clay-core/src/table/Row.tsx index efdf9aa171..5ec4a80a15 100644 --- a/packages/clay-core/src/table/Row.tsx +++ b/packages/clay-core/src/table/Row.tsx @@ -153,10 +153,16 @@ function RowInner>( 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,