[v8.1.x] Variables: Fix not updating inside a Panel when the preceding Row uses "Repeat For" (#39141)

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)andMaria Alexandra authored and GitHub committed 2021-09-13 17:21:16 +02:00
1 parent 178b2ea0e5
commit 2cc19d6a7a
1 file changed
+5 -3
@@ -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;
}
}
}
}