diff --git a/packages/web/src/utility/contextMenu.ts b/packages/web/src/utility/contextMenu.ts index 5705bdf6..46365f2e 100644 --- a/packages/web/src/utility/contextMenu.ts +++ b/packages/web/src/utility/contextMenu.ts @@ -1,6 +1,7 @@ import _ from 'lodash'; import { getContext, setContext } from 'svelte'; import invalidateCommands from '../commands/invalidateCommands'; +import { runGroupCommand } from '../commands/runCommand'; import { currentDropDownMenu, visibleCommandPalette } from '../stores'; import getAsArray from './getAsArray'; @@ -98,8 +99,12 @@ function mapItem(item, commands) { text: item.text || command.menuName || command.toolbarName || command.name, keyText: command.keyText || command.keyTextFromGroup, onClick: () => { - if (command.getSubCommands) visibleCommandPalette.set(command); - else if (command.onClick) command.onClick(); + if (command.isGroupCommand) { + runGroupCommand(command.group); + } else { + if (command.getSubCommands) visibleCommandPalette.set(command); + else if (command.onClick) command.onClick(); + } }, disabled: !command.enabled, hideDisabled: item.hideDisabled,