diff --git a/public/app/features/dashboard-scene/scene/PanelRepeaterGridItem.tsx b/public/app/features/dashboard-scene/scene/PanelRepeaterGridItem.tsx index d02442c2075..1ce4054f67e 100644 --- a/public/app/features/dashboard-scene/scene/PanelRepeaterGridItem.tsx +++ b/public/app/features/dashboard-scene/scene/PanelRepeaterGridItem.tsx @@ -196,7 +196,7 @@ function useLayoutStyle(direction: RepeatDirection, itemCount: number, maxPerRow if (direction === 'h') { const rowCount = Math.ceil(itemCount / maxPerRow); - const columnCount = Math.ceil(itemCount / rowCount); + const columnCount = Math.min(itemCount, maxPerRow); return css({ display: 'grid',