From db722d580f44c48a0b3f6fe1e735e7821450732f Mon Sep 17 00:00:00 2001 From: Prateek Shourya Date: Wed, 3 Jul 2024 13:11:51 +0530 Subject: [PATCH] [WEB-1801] fix: avoid opening shortcut guide on editors / input elements. (#5025) --- web/core/components/command-palette/command-palette.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/core/components/command-palette/command-palette.tsx b/web/core/components/command-palette/command-palette.tsx index acb1701d2..619cdd920 100644 --- a/web/core/components/command-palette/command-palette.tsx +++ b/web/core/components/command-palette/command-palette.tsx @@ -206,10 +206,6 @@ export const CommandPalette: FC = observer(() => { toggleCommandPaletteModal(true); } - if (shiftClicked && (keyPressed === "?" || keyPressed === "/") && !isAnyModalOpen) { - e.preventDefault(); - toggleShortcutModal(true); - } // if on input, textarea or editor, don't do anything if ( e.target instanceof HTMLTextAreaElement || @@ -218,6 +214,11 @@ export const CommandPalette: FC = observer(() => { ) return; + if (shiftClicked && (keyPressed === "?" || keyPressed === "/") && !isAnyModalOpen) { + e.preventDefault(); + toggleShortcutModal(true); + } + if (cmdClicked) { if (keyPressed === "c" && ((platform === "MacOS" && ctrlKey) || altKey)) { e.preventDefault();