From 186cd96447fdd3a9ae26907a48023998c825c6d6 Mon Sep 17 00:00:00 2001 From: Nathan Marrs Date: Wed, 31 May 2023 15:31:10 -0700 Subject: [PATCH] Canvas: Fix exit panel edit mode issue (#69315) Co-authored-by: Ryan McKinley --- public/app/features/canvas/runtime/scene.tsx | 4 ++-- public/app/plugins/panel/canvas/CanvasPanel.tsx | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/public/app/features/canvas/runtime/scene.tsx b/public/app/features/canvas/runtime/scene.tsx index 68489e95121..f58a7232687 100644 --- a/public/app/features/canvas/runtime/scene.tsx +++ b/public/app/features/canvas/runtime/scene.tsx @@ -643,8 +643,8 @@ export class Scene { render() { const canShowContextMenu = this.isPanelEditing || (!this.isPanelEditing && this.isEditingEnabled); - const canShowElementTooltip = - !this.isEditingEnabled && this.tooltip?.element && this.tooltip.element.data.links?.length > 0; + const isTooltipValid = (this.tooltip?.element?.data?.links?.length ?? 0) > 0; + const canShowElementTooltip = !this.isEditingEnabled && isTooltipValid; return (
diff --git a/public/app/plugins/panel/canvas/CanvasPanel.tsx b/public/app/plugins/panel/canvas/CanvasPanel.tsx index ef6e797f076..7731515da49 100644 --- a/public/app/plugins/panel/canvas/CanvasPanel.tsx +++ b/public/app/plugins/panel/canvas/CanvasPanel.tsx @@ -90,11 +90,6 @@ export class CanvasPanel extends Component { if (this.props.id === evt.payload) { this.needsReload = true; this.scene.clearCurrentSelection(); - this.scene.load( - this.props.options.root, - this.props.options.inlineEditing, - this.props.options.showAdvancedTypes - ); } }) );