[WEB-1801] fix: avoid opening shortcut guide on editors / input elements. (#5025)

This commit is contained in:
Prateek Shourya
2024-07-03 13:11:51 +05:30
committed by GitHub
parent 0363057d9c
commit db722d580f

View File

@@ -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();