2727-fix(front): CommandMenu and KeyboardMenu invoke handled (#2783)

* 2727-fix(front): CommandMenu and KeyboardMenu invoke handled

* Fix Command Menu and bug on metadata re-render

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Kanav Arora
2023-12-02 04:15:42 +05:30
committed by GitHub
parent fec8223ab8
commit 31f29582d0
5 changed files with 39 additions and 31 deletions

View File

@ -1,5 +1,6 @@
import { useRecoilValue } from 'recoil';
import { useCommandMenu } from '@/command-menu/hooks/useCommandMenu';
import { useScopedHotkeys } from '@/ui/utilities/hotkey/hooks/useScopedHotkeys';
import { AppHotkeyScope } from '@/ui/utilities/hotkey/types/AppHotkeyScope';
@ -20,9 +21,11 @@ export const KeyboardShortcutMenu = () => {
const isKeyboardShortcutMenuOpened = useRecoilValue(
isKeyboardShortcutMenuOpenedState,
);
const { closeCommandMenu } = useCommandMenu();
useScopedHotkeys(
'shift+?,meta+?',
() => {
closeCommandMenu();
toggleKeyboardShortcutMenu();
},
AppHotkeyScope.KeyboardShortcutMenu,
@ -30,7 +33,7 @@ export const KeyboardShortcutMenu = () => {
);
useScopedHotkeys(
'Esc',
'esc',
() => {
closeKeyboardShortcutMenu();
},