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) {
|
||||
const repeatBehavior = new RowRepeaterBehavior({ variableName: repeat });
|
||||
row.setState({ $behaviors: [...(row.state.$behaviors ?? []), repeatBehavior] });
|
||||
} else if (repeatBehavior) {
|
||||
if (title !== row.state.title) {
|
||||
row.setState({ title });
|
||||
}
|
||||
|
||||
if (repeat) {
|
||||
// Remove repeat behavior if it exists
|
||||
// to retrigger repeat when adding new one
|
||||
if (repeatBehavior) {
|
||||
repeatBehavior.removeBehavior();
|
||||
}
|
||||
|
||||
if (title !== row.state.title) {
|
||||
row.setState({ title });
|
||||
repeatBehavior = new RowRepeaterBehavior({ variableName: repeat });
|
||||
row.setState({ $behaviors: [...(row.state.$behaviors ?? []), repeatBehavior] });
|
||||
} else {
|
||||
repeatBehavior?.removeBehavior();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user