diff --git a/public/app/features/dashboard-scene/scene/layout-rows/RowsLayoutManager.tsx b/public/app/features/dashboard-scene/scene/layout-rows/RowsLayoutManager.tsx index 7f1100f3ed3..b2da3a617f3 100644 --- a/public/app/features/dashboard-scene/scene/layout-rows/RowsLayoutManager.tsx +++ b/public/app/features/dashboard-scene/scene/layout-rows/RowsLayoutManager.tsx @@ -90,8 +90,7 @@ export class RowsLayoutManager extends SceneObjectBase i public duplicateRow(row: RowItem) { const newRow = row.duplicate(); - this.setState({ rows: [...this.state.rows, newRow] }); - this.publishEvent(new NewObjectAddedToCanvasEvent(newRow), true); + this.addNewRow(newRow); } public addNewRow(row?: RowItem): RowItem { diff --git a/public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx b/public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx index 3de76a2e053..039a889ec21 100644 --- a/public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx +++ b/public/app/features/dashboard-scene/scene/layout-tabs/TabsLayoutManager.tsx @@ -70,7 +70,7 @@ export class TabsLayoutManager extends SceneObjectBase i public duplicateTab(tab: TabItem) { const newTab = tab.duplicate(); - this.setState({ tabs: [...this.state.tabs, newTab] }); + this.addNewTab(newTab); } public getUrlState() {