AutoGridItem: Reset repeatedPanels when disabling repeats (#111072)

reset repeatedPanels when disabling repeats
This commit is contained in:
Sergej-Vlasov
2025-09-15 08:59:40 +00:00
committed by GitHub
parent 6c35bb2c6e
commit f73cb477cb
2 changed files with 8 additions and 0 deletions
@@ -141,6 +141,10 @@ export class AutoGridItem extends SceneObjectBase<AutoGridItemState> implements
public setRepeatByVariable(variableName: string | undefined) {
const stateUpdate: Partial<AutoGridItemState> = { variableName };
if (!variableName) {
stateUpdate.repeatedPanels = undefined;
}
if (this.state.body.state.$variables) {
this.state.body.setState({ $variables: undefined });
}
@@ -234,6 +234,10 @@ export class DashboardGridItem
public setRepeatByVariable(variableName: string | undefined) {
const stateUpdate: Partial<DashboardGridItemState> = { variableName };
if (!variableName) {
stateUpdate.repeatedPanels = undefined;
}
if (variableName && !this.state.repeatDirection) {
stateUpdate.repeatDirection = 'h';
}