AutoGridItem: Reset repeatedPanels when disabling repeats (#111072)

reset repeatedPanels when disabling repeats
This commit is contained in:
Sergej-Vlasov 2025-09-15 11:59:40 +03:00 committed by GitHub
parent 6c35bb2c6e
commit f73cb477cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -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 });
}

View File

@ -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';
}