diff --git a/public/app/features/dashboard-scene/sharing/ShareModal.tsx b/public/app/features/dashboard-scene/sharing/ShareModal.tsx index 8a325d5d0b9c9..da4d8c75320ef 100644 --- a/public/app/features/dashboard-scene/sharing/ShareModal.tsx +++ b/public/app/features/dashboard-scene/sharing/ShareModal.tsx @@ -88,7 +88,12 @@ export class ShareModal extends SceneObjectBase implements Moda } onDismiss = () => { - locationService.partial({ shareView: null }); + if (this.state.panelRef) { + const dashboard = getDashboardSceneFor(this); + dashboard.closeModal(); + } else { + locationService.partial({ shareView: null }); + } }; onChangeTab: ComponentProps['onChangeTab'] = (tab) => {