diff --git a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx index 9fbaf7f9cfa..86b67303f8e 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx @@ -85,9 +85,9 @@ export class DashboardGridItem const stateChange: Partial = {}; if (this.getRepeatDirection() === 'v') { - stateChange.itemHeight = Math.ceil(newState.height! / this.getPanelCount()); + stateChange.itemHeight = Math.ceil(newState.height! / this.getChildCount()); } else { - const rowCount = Math.ceil(this.getPanelCount() / this.getMaxPerRow()); + const rowCount = Math.ceil(this.getChildCount() / this.getMaxPerRow()); stateChange.itemHeight = Math.ceil(newState.height! / rowCount); } @@ -96,7 +96,7 @@ export class DashboardGridItem } } - public getPanelCount() { + public getChildCount() { return (this.state.repeatedPanels?.length ?? 0) + 1; } diff --git a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItemRenderer.tsx b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItemRenderer.tsx index d99fa8db38e..7fa8ca8e211 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItemRenderer.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItemRenderer.tsx @@ -14,7 +14,7 @@ export function DashboardGridItemRenderer({ model }: SceneComponentProps