From eb5a96eae9610b3bad316cd76772dc5d7e59c1f1 Mon Sep 17 00:00:00 2001 From: Nathan Marrs Date: Wed, 13 Jul 2022 15:33:43 -0700 Subject: [PATCH] Canvas: Remove Open Editor option from context menu when in normal editor mode #52186 --- .../panel/canvas/CanvasContextMenu.tsx | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/public/app/plugins/panel/canvas/CanvasContextMenu.tsx b/public/app/plugins/panel/canvas/CanvasContextMenu.tsx index bfdd0b6a4d953..e3cb75922ee5a 100644 --- a/public/app/plugins/panel/canvas/CanvasContextMenu.tsx +++ b/public/app/plugins/panel/canvas/CanvasContextMenu.tsx @@ -91,20 +91,22 @@ export const CanvasContextMenu = ({ scene }: Props) => { }} className={styles.menuItem} /> - { - if (scene.inlineEditingCallback) { - if (inlineEditorOpen) { - activePanel.panel.inlineEditButtonClose(); - } else { - scene.inlineEditingCallback(); + {!scene.isPanelEditing && ( + { + if (scene.inlineEditingCallback) { + if (inlineEditorOpen) { + activePanel.panel.inlineEditButtonClose(); + } else { + scene.inlineEditingCallback(); + } } - } - closeContextMenu(); - }} - className={styles.menuItem} - /> + closeContextMenu(); + }} + className={styles.menuItem} + /> + )} ); };