From f73cb477cb6979f8b3abfe4f7b738e02b5259b2f Mon Sep 17 00:00:00 2001 From: Sergej-Vlasov <37613182+Sergej-Vlasov@users.noreply.github.com> Date: Mon, 15 Sep 2025 11:59:40 +0300 Subject: [PATCH] AutoGridItem: Reset repeatedPanels when disabling repeats (#111072) reset repeatedPanels when disabling repeats --- .../dashboard-scene/scene/layout-auto-grid/AutoGridItem.tsx | 4 ++++ .../scene/layout-default/DashboardGridItem.tsx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/public/app/features/dashboard-scene/scene/layout-auto-grid/AutoGridItem.tsx b/public/app/features/dashboard-scene/scene/layout-auto-grid/AutoGridItem.tsx index 953f7b7dbb8..5a88e451fb0 100644 --- a/public/app/features/dashboard-scene/scene/layout-auto-grid/AutoGridItem.tsx +++ b/public/app/features/dashboard-scene/scene/layout-auto-grid/AutoGridItem.tsx @@ -141,6 +141,10 @@ export class AutoGridItem extends SceneObjectBase implements public setRepeatByVariable(variableName: string | undefined) { const stateUpdate: Partial = { variableName }; + if (!variableName) { + stateUpdate.repeatedPanels = undefined; + } + if (this.state.body.state.$variables) { this.state.body.setState({ $variables: undefined }); } 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 271fc3bdd42..2a2c741c425 100644 --- a/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx +++ b/public/app/features/dashboard-scene/scene/layout-default/DashboardGridItem.tsx @@ -234,6 +234,10 @@ export class DashboardGridItem public setRepeatByVariable(variableName: string | undefined) { const stateUpdate: Partial = { variableName }; + if (!variableName) { + stateUpdate.repeatedPanels = undefined; + } + if (variableName && !this.state.repeatDirection) { stateUpdate.repeatDirection = 'h'; }