diff --git a/packages/module/src/WidgetLayout/GridLayout.tsx b/packages/module/src/WidgetLayout/GridLayout.tsx index 5b7d6f6..ecbfb3d 100644 --- a/packages/module/src/WidgetLayout/GridLayout.tsx +++ b/packages/module/src/WidgetLayout/GridLayout.tsx @@ -250,6 +250,7 @@ const GridLayout = ({ key={'grid-' + layoutVariant} layout={internalTemplate[layoutVariant]} width={effectiveWidth} + className={activeLayout.length === 0 ? 'pf-v6-widget-grid--empty' : undefined} droppingItem={droppingItemTemplate} gridConfig={{ cols: columns[layoutVariant], diff --git a/packages/module/src/WidgetLayout/__tests__/GridLayout.test.tsx b/packages/module/src/WidgetLayout/__tests__/GridLayout.test.tsx index 30cdf5c..07b54de 100644 --- a/packages/module/src/WidgetLayout/__tests__/GridLayout.test.tsx +++ b/packages/module/src/WidgetLayout/__tests__/GridLayout.test.tsx @@ -9,10 +9,11 @@ import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon'; // so we replace it with a pass-through that renders children and triggers onLayoutChange jest.mock('react-grid-layout', () => { const React = require('react'); - const MockGridLayout = ({ children, onLayoutChange, layout }: { + const MockGridLayout = ({ children, onLayoutChange, layout, className }: { children: React.ReactNode; onLayoutChange?: (layout: unknown[]) => void; layout?: unknown[]; + className?: string; [key: string]: unknown; }) => { const calledRef = React.useRef(false); @@ -22,7 +23,7 @@ jest.mock('react-grid-layout', () => { onLayoutChange?.(layout || []); } }); - return