mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
DashboardScene: Fix row actions removing behavior on second update (#94333)
fix row actions removing behavior on second update
This commit is contained in:
parent
b8df574aba
commit
a63a271f88
@ -54,15 +54,21 @@ export class RowActions extends SceneObjectBase<RowActionsState> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (repeat && !repeatBehavior) {
|
if (title !== row.state.title) {
|
||||||
const repeatBehavior = new RowRepeaterBehavior({ variableName: repeat });
|
row.setState({ title });
|
||||||
row.setState({ $behaviors: [...(row.state.$behaviors ?? []), repeatBehavior] });
|
}
|
||||||
} else if (repeatBehavior) {
|
|
||||||
|
if (repeat) {
|
||||||
|
// Remove repeat behavior if it exists
|
||||||
|
// to retrigger repeat when adding new one
|
||||||
|
if (repeatBehavior) {
|
||||||
repeatBehavior.removeBehavior();
|
repeatBehavior.removeBehavior();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title !== row.state.title) {
|
repeatBehavior = new RowRepeaterBehavior({ variableName: repeat });
|
||||||
row.setState({ title });
|
row.setState({ $behaviors: [...(row.state.$behaviors ?? []), repeatBehavior] });
|
||||||
|
} else {
|
||||||
|
repeatBehavior?.removeBehavior();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user