From 618b61e0a06a4021d767b0c0bcc5aede0feb8628 Mon Sep 17 00:00:00 2001 From: Maria Alexandra <239999+axelavargas@users.noreply.github.com> Date: Mon, 13 Sep 2021 16:47:01 +0200 Subject: [PATCH] Variables: Fix not updating inside a Panel when the preceding Row uses "Repeat For" (#38935) Added a condition to the `repeatRow` function to only update GridPos if we actually rendered more than 1 repeated row. (cherry picked from commit 04e7736cbab99377f9783edd75f27cf366976a1a) --- public/app/features/dashboard/state/DashboardModel.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/state/DashboardModel.ts b/public/app/features/dashboard/state/DashboardModel.ts index e20a203ca1fe..13eb63099a35 100644 --- a/public/app/features/dashboard/state/DashboardModel.ts +++ b/public/app/features/dashboard/state/DashboardModel.ts @@ -714,9 +714,11 @@ export class DashboardModel { panelBelowIndex = insertPos + rowPanels.length; } - // Update gridPos for panels below - for (let i = panelBelowIndex; i < this.panels.length; i++) { - this.panels[i].gridPos.y += yPos; + // Update gridPos for panels below if we inserted more than 1 repeated row panel + if (selectedOptions.length > 1) { + for (let i = panelBelowIndex; i < this.panels.length; i++) { + this.panels[i].gridPos.y += yPos; + } } } }