From 77a6dc7de902620e71dacc6ce24b47d46e25496b Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 1 Jun 2023 00:03:55 +0100 Subject: [PATCH] [v10.0.x] Canvas: Fix exit panel edit mode issue (#69352) Canvas: Fix exit panel edit mode issue (#69315) Co-authored-by: Ryan McKinley (cherry picked from commit 186cd96447fdd3a9ae26907a48023998c825c6d6) Co-authored-by: Nathan Marrs --- 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 5a80d311fa7..80bb5565d4f 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 0b80d268ae7..7f67c5cb09f 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 - ); } }) );