From 007517da1fa3bf145fcd09c6b411c50c0947b057 Mon Sep 17 00:00:00 2001 From: Rajdeep Das Date: Fri, 17 Oct 2025 08:18:36 +0000 Subject: [PATCH] fix: resolve shortcut conflict between command menu and set link in notes editor --- .../command-menu/hooks/useCommandMenuHotKeys.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts index 5535b8e8cfd5c..eaab5208b008b 100644 --- a/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts +++ b/packages/twenty-front/src/modules/command-menu/hooks/useCommandMenuHotKeys.ts @@ -45,9 +45,18 @@ export const useCommandMenuHotKeys = () => { useGlobalHotkeys({ keys: ['ctrl+k', 'meta+k'], - callback: () => { - closeKeyboardShortcutMenu(); - toggleCommandMenu(); + callback: (e: KeyboardEvent) => { + const active = document.activeElement; + const isInEditor = active?.closest('.editor'); + if (isInEditor !== null) { + return true; + } + + if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'k') { + e.preventDefault(); + closeKeyboardShortcutMenu(); + toggleCommandMenu(); + } }, containsModifier: true, dependencies: [closeKeyboardShortcutMenu, toggleCommandMenu],